MCPcopy Create free account
hub / github.com/Gecode/gecode / rrealloc

Method rrealloc

gecode/support/heap.hpp:390–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388 }
389
390 forceinline void*
391 Heap::rrealloc(void* p, size_t s) {
392#ifdef GECODE_PEAKHEAP
393 _m.acquire();
394 _cur -= GECODE_MSIZE(p);
395 _m.release();
396#endif
397 p = Support::allocator.realloc(p,s);
398#ifdef GECODE_PEAKHEAP
399 _m.acquire();
400 _cur += GECODE_MSIZE(p);
401 _peak = std::max(_peak,_cur);
402 _m.release();
403#endif
404 if (p != nullptr || s == 0)
405 return p;
406 throw MemoryExhausted();
407 }
408
409
410 /*

Callers

nothing calls this directly

Calls 4

maxFunction · 0.50
acquireMethod · 0.45
releaseMethod · 0.45
reallocMethod · 0.45

Tested by

no test coverage detected