Skip to content

Commit 266bfdb

Browse files
committed
rename Allocate call
1 parent 56393d3 commit 266bfdb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_http_parser.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)