1. 01 Sep, 2014 5 commits
    • Kosta's avatar
      fixed a compiler error not caught by VS2012... · 697cf407
      Kosta authored
      697cf407
    • Kosta's avatar
      allow the short string optimization to store one more character · d2a374b4
      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).
      d2a374b4
    • Kosta's avatar
      code cleanup for `StringEqual()` · b92d0ebd
      Kosta authored
      Instead of replicating the functionality of `GetString()` and `GetStringLength()` in `StringEqual()` it now calls these methods instead.
      b92d0ebd
    • Kosta's avatar
      short string optimization · 3caa86c9
      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.
      3caa86c9
    • Milo Yip's avatar
      Merge pull request #129 from pah/bug/compare-uint64-double · 2a4e0555
      Milo Yip authored
      Failing comparisons between certain (Ui|I)nt64 numbers
      2a4e0555
  2. 31 Aug, 2014 2 commits
  3. 30 Aug, 2014 7 commits
  4. 28 Aug, 2014 6 commits
  5. 27 Aug, 2014 2 commits
  6. 26 Aug, 2014 3 commits
  7. 23 Aug, 2014 2 commits
  8. 21 Aug, 2014 5 commits
  9. 20 Aug, 2014 8 commits