MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / stackful_malloc

Method stackful_malloc

thread/thread.cpp:242–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240 "stack_alloc_header size not fit");
241
242 void* stackful_malloc(size_t size) {
243 auto ret = stackful_alloc_top;
244 stackful_alloc_top += size;
245 auto head = (stack_alloc_header*)stackful_alloc_top;
246 head->size = size;
247 stackful_alloc_top += sizeof(stack_alloc_header);
248 return ret;
249 }
250
251 void stackful_free(void* ptr) {
252 assert(((uint64_t)ptr) < ((uint64_t)stackful_alloc_top));

Callers 1

stackful_mallocFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected