| 202 | } |
| 203 | |
| 204 | char* SimpleStringInternalCache::alloc(size_t size) |
| 205 | { |
| 206 | if (isCached(size)) { |
| 207 | if (hasFreeBlocksOfSize(size)) |
| 208 | return reserveCachedBlockFrom(getCacheNodeFromSize(size))->memory_; |
| 209 | else |
| 210 | return allocateNewCacheBlockFrom(getCacheNodeFromSize(size))->memory_; |
| 211 | } |
| 212 | |
| 213 | nonCachedAllocations_ = createSimpleStringMemoryBlock(size, nonCachedAllocations_); |
| 214 | return nonCachedAllocations_->memory_; |
| 215 | } |
| 216 | |
| 217 | void SimpleStringInternalCache::dealloc(char* memory, size_t size) |
| 218 | { |