Expand (or shrink) in place (or fail)
| 345 | |
| 346 | // Expand (or shrink) in place (or fail) |
| 347 | void* mi_expand(void* p, size_t newsize) mi_attr_noexcept { |
| 348 | #if MI_PADDING |
| 349 | // we do not shrink/expand with padding enabled |
| 350 | MI_UNUSED(p); MI_UNUSED(newsize); |
| 351 | return NULL; |
| 352 | #else |
| 353 | if (p == NULL) return NULL; |
| 354 | const mi_page_t* const page = mi_validate_ptr_page(p,"mi_expand"); |
| 355 | const size_t size = _mi_usable_size(p,page); |
| 356 | if (newsize > size) return NULL; |
| 357 | return p; // it fits |
| 358 | #endif |
| 359 | } |
| 360 | |
| 361 | void* _mi_theap_realloc_zero(mi_theap_t* theap, void* p, size_t newsize, bool zero, size_t* usable_pre, size_t* usable_post) mi_attr_noexcept { |
| 362 | // if p == NULL then behave as malloc. |
no test coverage detected