MCPcopy Create free account
hub / github.com/beefytech/Beef / StompAlloc

Function StompAlloc

BeefRT/rt/StompAlloc.cpp:173–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171__declspec(dllexport)
172#endif
173void* StompAlloc(intptr size)
174{
175 AutoCrit autoCrit(gSA_CritSect);
176
177 while (true)
178 {
179 for (auto itr = gAllocRanges.rbegin(); itr != gAllocRanges.rend(); itr++)
180 {
181 auto& alloc = *itr;
182 void* result = alloc.Alloc((int)size);
183 if (result != NULL)
184 return result;
185 }
186
187 gAllocRanges.resize(gAllocRanges.size() + 1);
188 }
189}
190
191extern "C"
192#ifdef BF_STOMP_EXPORT

Callers 2

MallocMethod · 0.70
Dbg_ObjectAllocMethod · 0.50

Calls 3

AllocMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected