diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2019-08-15 16:03:25 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2019-08-15 16:03:25 +0200 |
commit | c430711fbb07caceb2acc81ea04f2a9b4a7732da (patch) | |
tree | 55d89f6813ddc630ad305fe241c2fe0b81699e26 /vespalib | |
parent | f70d4cece53a9d49001656528530747f4a3ba8f3 (diff) |
Extend class comment for UniqueStoreStringAllocator.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/datastore/unique_store_string_allocator.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/unique_store_string_allocator.h b/vespalib/src/vespa/vespalib/datastore/unique_store_string_allocator.h index e914c4c7f66..b4ceab4c804 100644 --- a/vespalib/src/vespa/vespalib/datastore/unique_store_string_allocator.h +++ b/vespalib/src/vespa/vespalib/datastore/unique_store_string_allocator.h @@ -75,7 +75,14 @@ public: /** * Allocator for unique NUL-terminated strings that is accessed via a - * 32-bit EntryRef. + * 32-bit EntryRef. Multiple buffer types are used. Small strings use + * a common buffer type handler with different parameters for array + * size (which denotes number of bytes set aside for meta data + * (reference count), string and NUL byte. Large strings use a + * different buffer type handler where buffer contains meta data + * (reference count) and an std::string, while the string value is on + * the heap. string_allocator::get_type_id() is used to map from + * string length to type id. */ template <typename RefT = EntryRefT<22> > class UniqueStoreStringAllocator : public ICompactable @@ -97,8 +104,7 @@ public: EntryRef allocate(const char *value); void hold(EntryRef ref); EntryRef move(EntryRef ref) override; - const UniqueStoreEntryBase& getWrapped(EntryRef ref) const - { + const UniqueStoreEntryBase& getWrapped(EntryRef ref) const { RefType iRef(ref); auto &state = _store.getBufferState(iRef.bufferId()); auto type_id = state.getTypeId(); |