Lines Matching refs:shared_

173shared_(static_cast<SharedData*>(baseAllocator_ ? baseAllocator_->Malloc(SIZEOF_SHARED_DATA + SIZE…  in chunk_capacity_()
176 RAPIDJSON_ASSERT(shared_ != 0); in chunk_capacity_()
178 shared_->ownBaseAllocator = 0; in chunk_capacity_()
181 shared_->ownBaseAllocator = baseAllocator_; in chunk_capacity_()
183 shared_->chunkHead = GetChunkHead(shared_); in chunk_capacity_()
184 shared_->chunkHead->capacity = 0; in chunk_capacity_()
185 shared_->chunkHead->size = 0; in chunk_capacity_()
186 shared_->chunkHead->next = 0; in chunk_capacity_()
187 shared_->ownBuffer = true; in chunk_capacity_()
188 shared_->refcount = 1; in chunk_capacity_()
204 shared_(static_cast<SharedData*>(AlignBuffer(buffer, size))) in chunk_capacity_()
207 shared_->chunkHead = GetChunkHead(shared_); in chunk_capacity_()
208 shared_->chunkHead->capacity = size - SIZEOF_SHARED_DATA - SIZEOF_CHUNK_HEADER; in chunk_capacity_()
209 shared_->chunkHead->size = 0; in chunk_capacity_()
210 shared_->chunkHead->next = 0; in chunk_capacity_()
211 shared_->ownBaseAllocator = 0; in chunk_capacity_()
212 shared_->ownBuffer = false; in chunk_capacity_()
213 shared_->refcount = 1; in chunk_capacity_()
219 shared_(rhs.shared_) in MemoryPoolAllocator()
221 RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); in MemoryPoolAllocator()
222 ++shared_->refcount; in MemoryPoolAllocator()
226 RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0);
227 ++rhs.shared_->refcount;
231 shared_ = rhs.shared_;
239 shared_(rhs.shared_) in MemoryPoolAllocator()
241 RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); in MemoryPoolAllocator()
242 rhs.shared_ = 0; in MemoryPoolAllocator()
246 RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0);
250 shared_ = rhs.shared_;
251 rhs.shared_ = 0;
260 if (!shared_) { in ~MemoryPoolAllocator()
264 if (shared_->refcount > 1) { in ~MemoryPoolAllocator()
265 --shared_->refcount; in ~MemoryPoolAllocator()
269 BaseAllocator *a = shared_->ownBaseAllocator; in ~MemoryPoolAllocator()
270 if (shared_->ownBuffer) { in ~MemoryPoolAllocator()
271 baseAllocator_->Free(shared_); in ~MemoryPoolAllocator()
278 RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); in Clear()
280 ChunkHeader* c = shared_->chunkHead; in Clear()
284 shared_->chunkHead = c->next; in Clear()
287 shared_->chunkHead->size = 0; in Clear()
294 RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); in Capacity()
296 for (ChunkHeader* c = shared_->chunkHead; c != 0; c = c->next) in Capacity()
305 RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); in Size()
307 for (ChunkHeader* c = shared_->chunkHead; c != 0; c = c->next) in Size()
316 RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); in Shared()
317 return shared_->refcount > 1; in Shared()
322 RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); in Malloc()
327 if (RAPIDJSON_UNLIKELY(shared_->chunkHead->size + size > shared_->chunkHead->capacity)) in Malloc()
331 void *buffer = GetChunkBuffer(shared_) + shared_->chunkHead->size; in Malloc()
332 shared_->chunkHead->size += size; in Malloc()
341 RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); in Realloc()
353 if (originalPtr == GetChunkBuffer(shared_) + shared_->chunkHead->size - originalSize) { in Realloc()
355 if (shared_->chunkHead->size + increment <= shared_->chunkHead->capacity) { in Realloc()
356 shared_->chunkHead->size += increment; in Realloc()
376 RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
377 RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0);
378 return shared_ == rhs.shared_;
392 shared_->ownBaseAllocator = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator)(); in AddChunk()
396 chunk->next = shared_->chunkHead; in AddChunk()
397 shared_->chunkHead = chunk; in AddChunk()
420 SharedData *shared_; //!< The shared data of the allocator variable