- 02 Sep, 2014 1 commit
-
-
Milo Yip authored
short string optimization
-
- 01 Sep, 2014 10 commits
-
-
Kosta authored
-
Kosta authored
-
Kosta authored
-
Kosta authored
-
Kosta authored
-
Kosta authored
-
Kosta authored
The `ShortString` can represent zero-terminated strings up to `MaxSize` chars (excluding the terminating zero) and store a value to determine the length of the contained string in the last character `str[LenPos]` by storing `MaxSize - length` there. If the string to store has the maximal length of `MaxSize` (excluding the terminating zero) then `str[LenPos]` will store `0` and therefore act as the string terminator as well. For getting the string length back from that value just use `MaxSize - str[LenPos]`. This allows to store `11`-chars strings in 32-bit mode and `15`-chars strings in 64-bit mode inline (for `UTF8`-encoded strings).
-
Kosta authored
Instead of replicating the functionality of `GetString()` and `GetStringLength()` in `StringEqual()` it now calls these methods instead.
-
Kosta authored
Since the payload (the `Data` union) of the current implementation of `GenericValue` is `12 bytes` (32 bit) or `16 bytes` (64 bit) it could store `UTF8`-encoded strings up to `10` or `14` chars plus the `terminating zero` character plus the string length: ``` C++ struct ShortString { enum { MaxSize = sizeof(GenericValue::String) / sizeof(Ch) - sizeof(unsigned char) }; Ch str[MaxSize]; unsigned char length; }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode ``` This is achieved by introducing additional `kInlineStrFlag` and `kShortStringFlag` flags. When setting a new string value in `SetStringRaw(s, alloc)` it is first checked if the string is short enough to fit into the `inline string buffer` and if so the given source string will be copied into the new `ShortString` target instead of allocating additional memory for it.
-
Milo Yip authored
Failing comparisons between certain (Ui|I)nt64 numbers
-
- 31 Aug, 2014 2 commits
-
-
Philipp A. Hartmann authored
Some 64-bit integers cannot be represented losslessly as a double. Due to a typo in the operator==, the comparison has been performed after a double conversion in too many cases.
-
Philipp A. Hartmann authored
-
- 30 Aug, 2014 7 commits
-
-
Milo Yip authored
Fix comparison operator ambiguities between Value/Document
-
Philipp A. Hartmann authored
Before applying the simplifications in ed282b81, the SFINAE check for the GenericValue(bool) constructor has been broken in MSVC 2005. Add a static assert as a safe-guard against future reappearance of this problem.
-
Philipp A. Hartmann authored
This finally fixes #113.
-
Philipp A. Hartmann authored
In order to match GenericValue and its derived classes for the SFINAE-implementation of some of the operators/functions, this meta-function matches all types equal to or derived from a given class. See std::is_base_of<B,D> available in C++11. Define RAPIDJSON_HAS_CXX_TYPETRAITS to use the C++11 implementation.
-
Philipp A. Hartmann authored
Some (older) compilers have problems with compile-time constants. This commit simplifies the implementation of the helper classes in order to improve compiler support, especially be removing the need of partial template specialisation. No functional changes.
-
Philipp A. Hartmann authored
-
Philipp A. Hartmann authored
Prepare equalto_operator tests to test comparisons between * GenericValue and GenericDocument * GenericValue with different SourceAllocator types Both combinations currently fail due to ambiguities with the templated operators on several compilers.
-
- 28 Aug, 2014 6 commits
- 27 Aug, 2014 2 commits
- 26 Aug, 2014 3 commits
-
-
Philipp A. Hartmann authored
As reported in #113, recent versions of Clang complain about ambiguous overloads for some comparison operator instantiations, especially if the deduced template type is a GenericValue. Add an explicit, non-templated version for now (which is a better match). This only solves part of the problem, as comparisons between * GenericValue & GenericDocument * GenericValue with different SourceAllocator types will still cause ambiguities.
-
Jan Wrobel authored
-
Philipp A. Hartmann authored
-
- 23 Aug, 2014 2 commits
- 21 Aug, 2014 5 commits
-
-
Milo Yip authored
GenericMemberIterator: fix comparisons/differences for mixed-constness expressions
-
Philipp A. Hartmann authored
-
Philipp A. Hartmann authored
-
Philipp A. Hartmann authored
-
Milo Yip authored
Parsing optimization
-
- 20 Aug, 2014 2 commits