MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_expand

Function mi_expand

3rd/mimalloc-2.0.9/src/alloc.c:666–677  ·  view source on GitHub ↗

Expand (or shrink) in place (or fail)

Source from the content-addressed store, hash-verified

664
665// Expand (or shrink) in place (or fail)
666void* mi_expand(void* p, size_t newsize) mi_attr_noexcept {
667 #if MI_PADDING
668 // we do not shrink/expand with padding enabled
669 MI_UNUSED(p); MI_UNUSED(newsize);
670 return NULL;
671 #else
672 if (p == NULL) return NULL;
673 const size_t size = _mi_usable_size(p,"mi_expand");
674 if (newsize > size) return NULL;
675 return p; // it fits
676 #endif
677}
678
679void* _mi_heap_realloc_zero(mi_heap_t* heap, void* p, size_t newsize, bool zero) mi_attr_noexcept {
680 // if p == NULL then behave as malloc.

Callers 1

mi__expandFunction · 0.85

Calls 1

_mi_usable_sizeFunction · 0.85

Tested by

no test coverage detected