|
|
@ -63,9 +63,14 @@ DUK_INTERNAL duk_hbuffer *duk_hbuffer_alloc(duk_heap *heap, duk_size_t size, duk |
|
|
|
DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap, h, ptr); |
|
|
|
DUK_HBUFFER_DYNAMIC_SET_ALLOC_SIZE(h, size); /* snug */ |
|
|
|
} else { |
|
|
|
#ifdef DUK_USE_EXPLICIT_NULL_INIT |
|
|
|
h->curr_alloc = NULL; |
|
|
|
#if defined(DUK_USE_EXPLICIT_NULL_INIT) |
|
|
|
#if defined(DUK_USE_HEAPPTR16) |
|
|
|
/* the compressed pointer is zeroed which maps to NULL, so nothing to do. */ |
|
|
|
#else |
|
|
|
DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap, h, NULL); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
DUK_ASSERT(DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap, h) == NULL); |
|
|
|
DUK_ASSERT(DUK_HBUFFER_DYNAMIC_GET_ALLOC_SIZE(h) == 0); |
|
|
|
} |
|
|
|
} |
|
|
|