1234567891011121314151617181920212223242526272829303132333435 |
- #include <string.h>
- #include "private.h"
- #include "context.h"
- #include "node.h"
- void lub_heap_pre_realloc(lub_heap_t * this, char **ptr, size_t * size)
- {
- if (*ptr) {
-
- lub_heap_node_t *node =
- lub_heap_node_from_start_of_block_ptr(*ptr);
- if (NULL != node) {
- lub_heap_node_fini(node);
-
- *ptr = (char *)node;
- }
- }
- if ((0 < lub_heap_frame_count)) {
- size_t old_size = *size;
- if (old_size) {
-
- *size += lub_heap_node__get_instanceSize();
- if (*size < old_size) {
-
- *size = (size_t) - 1;
- }
- }
- }
- }
|