am f9c68364: am de5c3a25: Construct TrieMap from existing buffer.

* commit 'f9c68364d3cf3758a2e7f1692632658c69150ba8':
  Construct TrieMap from existing buffer.
This commit is contained in:
Keisuke Kuroyanagi 2014-07-31 13:35:27 +00:00 committed by Android Git Automerger
commit 7baa9c3b7f
2 changed files with 6 additions and 0 deletions

View file

@ -43,6 +43,10 @@ TrieMap::TrieMap() : mBuffer(MAX_BUFFER_SIZE) {
writeEntry(EMPTY_BITMAP_ENTRY, ROOT_BITMAP_ENTRY_INDEX); writeEntry(EMPTY_BITMAP_ENTRY, ROOT_BITMAP_ENTRY_INDEX);
} }
TrieMap::TrieMap(uint8_t *const buffer, const int bufferSize)
: mBuffer(buffer, bufferSize,
BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE) {}
void TrieMap::dump(const int from, const int to) const { void TrieMap::dump(const int from, const int to) const {
AKLOGI("BufSize: %d", mBuffer.getTailPosition()); AKLOGI("BufSize: %d", mBuffer.getTailPosition());
for (int i = from; i < to; ++i) { for (int i = from; i < to; ++i) {

View file

@ -160,6 +160,8 @@ class TrieMap {
static const uint64_t MAX_VALUE; static const uint64_t MAX_VALUE;
TrieMap(); TrieMap();
// Construct TrieMap using existing data in the memory region written by save().
TrieMap(uint8_t *const buffer, const int bufferSize);
void dump(const int from = 0, const int to = 0) const; void dump(const int from = 0, const int to = 0) const;
bool isNearSizeLimit() const { bool isNearSizeLimit() const {