File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ class StringPtrAllocator {
132132 StringPtrAllocator () { buffer_.SetLength (0 ); }
133133
134134 // Allocate memory from the slab. Returns nullptr if full.
135- char * Allocate (size_t size) {
135+ char * TryAllocate (size_t size) {
136136 const size_t current = buffer_.length ();
137137 if (current + size > kSlabSize ) {
138138 return nullptr ;
@@ -171,7 +171,7 @@ struct StringPtr {
171171 }
172172 // Try allocator first, fall back to heap
173173 if (allocator_ != nullptr ) {
174- char * ptr = allocator_->Allocate (size_);
174+ char * ptr = allocator_->TryAllocate (size_);
175175 if (ptr != nullptr ) {
176176 memcpy (ptr, str_, size_);
177177 str_ = ptr;
@@ -205,7 +205,7 @@ struct StringPtr {
205205
206206 // Try allocator first (if not already on heap)
207207 if (!on_heap_ && allocator_ != nullptr ) {
208- new_str = allocator_->Allocate (new_size);
208+ new_str = allocator_->TryAllocate (new_size);
209209 }
210210
211211 if (new_str != nullptr ) {
You can’t perform that action at this time.
0 commit comments