Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
duk_hbuffer.h File Reference

Go to the source code of this file.

Data Structures

struct  duk_hbuffer
 
struct  duk_hbuffer_fixed
 
struct  duk_hbuffer_dynamic
 
struct  duk_hbuffer_external
 

Macros

#define DUK_HBUFFER_FLAG_DYNAMIC   DUK_HEAPHDR_USER_FLAG(0) /* buffer is behind a pointer, dynamic or external */
 
#define DUK_HBUFFER_FLAG_EXTERNAL   DUK_HEAPHDR_USER_FLAG(1) /* buffer pointer is to an externally allocated buffer */
 
#define DUK_HBUFFER_HAS_DYNAMIC(x)   DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC)
 
#define DUK_HBUFFER_HAS_EXTERNAL(x)   DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL)
 
#define DUK_HBUFFER_SET_DYNAMIC(x)   DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC)
 
#define DUK_HBUFFER_SET_EXTERNAL(x)   DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL)
 
#define DUK_HBUFFER_CLEAR_DYNAMIC(x)   DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC)
 
#define DUK_HBUFFER_CLEAR_EXTERNAL(x)   DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL)
 
#define DUK_HBUFFER_MAX_BYTELEN   (0x7ffffffeUL)
 
#define DUK_HBUFFER_GET_SIZE(x)   (((duk_hbuffer *) (x))->size)
 
#define DUK_HBUFFER_SET_SIZE(x, v)
 
#define DUK_HBUFFER_ADD_SIZE(x, dv)
 
#define DUK_HBUFFER_SUB_SIZE(x, dv)
 
#define DUK_HBUFFER_FIXED_GET_SIZE(x)   DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x))
 
#define DUK_HBUFFER_FIXED_SET_SIZE(x, v)   DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x))
 
#define DUK_HBUFFER_DYNAMIC_GET_SIZE(x)   DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x))
 
#define DUK_HBUFFER_DYNAMIC_SET_SIZE(x, v)   DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x), (v))
 
#define DUK_HBUFFER_DYNAMIC_ADD_SIZE(x, dv)   DUK_HBUFFER_ADD_SIZE((duk_hbuffer *) (x), (dv))
 
#define DUK_HBUFFER_DYNAMIC_SUB_SIZE(x, dv)   DUK_HBUFFER_SUB_SIZE((duk_hbuffer *) (x), (dv))
 
#define DUK_HBUFFER_EXTERNAL_GET_SIZE(x)   DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x))
 
#define DUK_HBUFFER_EXTERNAL_SET_SIZE(x, v)   DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x), (v))
 
#define DUK_HBUFFER_FIXED_GET_DATA_PTR(heap, x)   ((duk_uint8_t *) (((duk_hbuffer_fixed *) (x)) + 1))
 
#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap, x)   ((x)->curr_alloc)
 
#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap, x, v)
 
#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL(heap, x)
 
#define DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(heap, x)    ((void *) (x)->curr_alloc)
 
#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap, x, v)
 
#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR_NULL(heap, x)
 
#define DUK_HBUFFER_GET_DATA_PTR(heap, x)
 

Functions

DUK_INTERNAL_DECL duk_hbufferduk_hbuffer_alloc (duk_heap *heap, duk_size_t size, duk_small_uint_t flags, void **out_bufdata)
 
DUK_INTERNAL_DECL void * duk_hbuffer_get_dynalloc_ptr (duk_heap *heap, void *ud)
 
DUK_INTERNAL_DECL void duk_hbuffer_resize (duk_hthread *thr, duk_hbuffer_dynamic *buf, duk_size_t new_size)
 
DUK_INTERNAL_DECL void duk_hbuffer_reset (duk_hthread *thr, duk_hbuffer_dynamic *buf)
 

Macro Definition Documentation

◆ DUK_HBUFFER_ADD_SIZE

#define DUK_HBUFFER_ADD_SIZE ( x,
dv )
Value:
do { \
(x)->size += (dv); \
} while (0)

Definition at line 81 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

81#define DUK_HBUFFER_ADD_SIZE(x,dv) do { \
82 (x)->size += (dv); \
83 } while (0)

◆ DUK_HBUFFER_CLEAR_DYNAMIC

#define DUK_HBUFFER_CLEAR_DYNAMIC ( x)    DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC)

Definition at line 32 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_CLEAR_EXTERNAL

#define DUK_HBUFFER_CLEAR_EXTERNAL ( x)    DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL)

Definition at line 33 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_DYNAMIC_ADD_SIZE

#define DUK_HBUFFER_DYNAMIC_ADD_SIZE ( x,
dv )   DUK_HBUFFER_ADD_SIZE((duk_hbuffer *) (x), (dv))

Definition at line 94 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_DYNAMIC_GET_DATA_PTR

#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR ( heap,
x )   ((x)->curr_alloc)

Definition at line 112 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_DYNAMIC_GET_SIZE

#define DUK_HBUFFER_DYNAMIC_GET_SIZE ( x)    DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x))

Definition at line 92 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_DYNAMIC_SET_DATA_PTR

#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR ( heap,
x,
v )
Value:
do { \
(x)->curr_alloc = (void *) (v); \
} while (0)

Definition at line 113 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

113#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap,x,v) do { \
114 (x)->curr_alloc = (void *) (v); \
115 } while (0)

◆ DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL

#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL ( heap,
x )
Value:
do { \
(x)->curr_alloc = (void *) NULL; \
} while (0)
#define NULL
Definition gmacros.h:924

Definition at line 116 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

116#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL(heap,x) do { \
117 (x)->curr_alloc = (void *) NULL; \
118 } while (0)

◆ DUK_HBUFFER_DYNAMIC_SET_SIZE

#define DUK_HBUFFER_DYNAMIC_SET_SIZE ( x,
v )   DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x), (v))

Definition at line 93 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_DYNAMIC_SUB_SIZE

#define DUK_HBUFFER_DYNAMIC_SUB_SIZE ( x,
dv )   DUK_HBUFFER_SUB_SIZE((duk_hbuffer *) (x), (dv))

Definition at line 95 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_EXTERNAL_GET_DATA_PTR

#define DUK_HBUFFER_EXTERNAL_GET_DATA_PTR ( heap,
x )    ((void *) (x)->curr_alloc)

Definition at line 134 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

134#define DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(heap,x) \
135 ((void *) (x)->curr_alloc)

◆ DUK_HBUFFER_EXTERNAL_GET_SIZE

#define DUK_HBUFFER_EXTERNAL_GET_SIZE ( x)    DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x))

Definition at line 97 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_EXTERNAL_SET_DATA_PTR

#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR ( heap,
x,
v )
Value:
do { \
(x)->curr_alloc = (void *) (v); \
} while (0)

Definition at line 136 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

136#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap,x,v) do { \
137 (x)->curr_alloc = (void *) (v); \
138 } while (0)

◆ DUK_HBUFFER_EXTERNAL_SET_DATA_PTR_NULL

#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR_NULL ( heap,
x )
Value:
do { \
(x)->curr_alloc = (void *) NULL; \
} while (0)

Definition at line 139 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

139#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR_NULL(heap,x) do { \
140 (x)->curr_alloc = (void *) NULL; \
141 } while (0)

◆ DUK_HBUFFER_EXTERNAL_SET_SIZE

#define DUK_HBUFFER_EXTERNAL_SET_SIZE ( x,
v )   DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x), (v))

Definition at line 98 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_FIXED_GET_DATA_PTR

#define DUK_HBUFFER_FIXED_GET_DATA_PTR ( heap,
x )   ((duk_uint8_t *) (((duk_hbuffer_fixed *) (x)) + 1))

Definition at line 100 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_FIXED_GET_SIZE

#define DUK_HBUFFER_FIXED_GET_SIZE ( x)    DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x))

Definition at line 89 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_FIXED_SET_SIZE

#define DUK_HBUFFER_FIXED_SET_SIZE ( x,
v )   DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x))

Definition at line 90 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_FLAG_DYNAMIC

#define DUK_HBUFFER_FLAG_DYNAMIC   DUK_HEAPHDR_USER_FLAG(0) /* buffer is behind a pointer, dynamic or external */

Definition at line 23 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_FLAG_EXTERNAL

#define DUK_HBUFFER_FLAG_EXTERNAL   DUK_HEAPHDR_USER_FLAG(1) /* buffer pointer is to an externally allocated buffer */

Definition at line 24 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_GET_DATA_PTR

#define DUK_HBUFFER_GET_DATA_PTR ( heap,
x )
Value:
( \
DUK_HBUFFER_HAS_DYNAMIC((x)) ? \
DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((heap), (duk_hbuffer_dynamic *) (x)) : \
)
#define DUK_HBUFFER_FIXED_GET_DATA_PTR(heap, x)

Definition at line 161 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

161#define DUK_HBUFFER_GET_DATA_PTR(heap,x) ( \
162 DUK_HBUFFER_HAS_DYNAMIC((x)) ? \
163 DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((heap), (duk_hbuffer_dynamic *) (x)) : \
164 DUK_HBUFFER_FIXED_GET_DATA_PTR((heap), (duk_hbuffer_fixed *) (x)) \
165 )

◆ DUK_HBUFFER_GET_SIZE

#define DUK_HBUFFER_GET_SIZE ( x)    (((duk_hbuffer *) (x))->size)

Definition at line 77 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_HAS_DYNAMIC

#define DUK_HBUFFER_HAS_DYNAMIC ( x)    DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC)

Definition at line 26 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_HAS_EXTERNAL

#define DUK_HBUFFER_HAS_EXTERNAL ( x)    DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL)

Definition at line 27 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_MAX_BYTELEN

#define DUK_HBUFFER_MAX_BYTELEN   (0x7ffffffeUL)

Definition at line 51 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_SET_DYNAMIC

#define DUK_HBUFFER_SET_DYNAMIC ( x)    DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC)

Definition at line 29 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_SET_EXTERNAL

#define DUK_HBUFFER_SET_EXTERNAL ( x)    DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL)

Definition at line 30 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

◆ DUK_HBUFFER_SET_SIZE

#define DUK_HBUFFER_SET_SIZE ( x,
v )
Value:
do { \
((duk_hbuffer *) (x))->size = (v); \
} while (0)

Definition at line 78 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

78#define DUK_HBUFFER_SET_SIZE(x,v) do { \
79 ((duk_hbuffer *) (x))->size = (v); \
80 } while (0)

◆ DUK_HBUFFER_SUB_SIZE

#define DUK_HBUFFER_SUB_SIZE ( x,
dv )
Value:
do { \
(x)->size -= (dv); \
} while (0)

Definition at line 84 of file duktape-1.5.2/src-separate/duk_hbuffer.h.

84#define DUK_HBUFFER_SUB_SIZE(x,dv) do { \
85 (x)->size -= (dv); \
86 } while (0)

Function Documentation

◆ duk_hbuffer_alloc()

DUK_INTERNAL_DECL duk_hbuffer * duk_hbuffer_alloc ( duk_heap * heap,
duk_size_t size,
duk_small_uint_t flags,
void ** out_bufdata )

Definition at line 40476 of file duktape-1.5.2/src-noline/duktape.c.

40493 {
40494 duk_hbuffer *res = NULL;
40495 duk_size_t header_size;
40496 duk_size_t alloc_size;
40497
40498 DUK_ASSERT(heap != NULL);
40499 DUK_ASSERT(out_bufdata != NULL);
40500
40501 DUK_DDD(DUK_DDDPRINT("allocate hbuffer"));
40502
40503 /* Size sanity check. Should not be necessary because caller is
40504 * required to check this, but we don't want to cause a segfault
40505 * if the size wraps either in duk_size_t computation or when
40506 * storing the size in a 16-bit field.
40507 */
40508 if (size > DUK_HBUFFER_MAX_BYTELEN) {
40509 DUK_D(DUK_DPRINT("hbuffer alloc failed: size too large: %ld", (long) size));
40510 return NULL; /* no need to write 'out_bufdata' */
40511 }
40512
40513 if (flags & DUK_BUF_FLAG_EXTERNAL) {
40514 header_size = sizeof(duk_hbuffer_external);
40515 alloc_size = sizeof(duk_hbuffer_external);
40516 } else if (flags & DUK_BUF_FLAG_DYNAMIC) {
40517 header_size = sizeof(duk_hbuffer_dynamic);
40518 alloc_size = sizeof(duk_hbuffer_dynamic);
40519 } else {
40520 header_size = sizeof(duk_hbuffer_fixed);
40521 alloc_size = sizeof(duk_hbuffer_fixed) + size;
40522 DUK_ASSERT(alloc_size >= sizeof(duk_hbuffer_fixed)); /* no wrapping */
40523 }
40524
40525 res = (duk_hbuffer *) DUK_ALLOC(heap, alloc_size);
40526 if (!res) {
40527 goto error;
40528 }
40529
40530 /* zero everything unless requested not to do so */
40531#if defined(DUK_USE_ZERO_BUFFER_DATA)
40532 DUK_MEMZERO((void *) res,
40533 (flags & DUK_BUF_FLAG_NOZERO) ? header_size : alloc_size);
40534#else
40535 DUK_MEMZERO((void *) res, header_size);
40536#endif
40537
40538 if (flags & DUK_BUF_FLAG_EXTERNAL) {
40540 h = (duk_hbuffer_external *) res;
40541 DUK_UNREF(h);
40542 *out_bufdata = NULL;
40543#if defined(DUK_USE_EXPLICIT_NULL_INIT)
40544#if defined(DUK_USE_HEAPPTR16)
40545/* the compressed pointer is zeroed which maps to NULL, so nothing to do. */
40546#else
40548#endif
40549#endif
40551 } else if (flags & DUK_BUF_FLAG_DYNAMIC) {
40553 void *ptr;
40554
40555 if (size > 0) {
40556 DUK_ASSERT(!(flags & DUK_BUF_FLAG_EXTERNAL)); /* alloc external with size zero */
40557 DUK_DDD(DUK_DDDPRINT("dynamic buffer with nonzero size, alloc actual buffer"));
40558#ifdef DUK_USE_ZERO_BUFFER_DATA
40559 ptr = DUK_ALLOC_ZEROED(heap, size);
40560#else
40561 ptr = DUK_ALLOC(heap, size);
40562#endif
40563 if (!ptr) {
40564 /* Because size > 0, NULL check is correct */
40565 goto error;
40566 }
40567 *out_bufdata = ptr;
40568
40570 } else {
40571 *out_bufdata = NULL;
40572#if defined(DUK_USE_EXPLICIT_NULL_INIT)
40573#if defined(DUK_USE_HEAPPTR16)
40574/* the compressed pointer is zeroed which maps to NULL, so nothing to do. */
40575#else
40577#endif
40578#endif
40580 }
40581 } else {
40582 *out_bufdata = (void *) ((duk_hbuffer_fixed *) res + 1);
40583 }
40584
40585 DUK_HBUFFER_SET_SIZE(res, size);
40586
40588 if (flags & DUK_BUF_FLAG_DYNAMIC) {
#define DUK_MEMZERO(p, n)
#define DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(heap, x)
#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap, x)
#define DUK_ALLOC(heap, size)
struct duk_hbuffer_dynamic duk_hbuffer_dynamic
#define DUK_HBUFFER_MAX_BYTELEN
#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap, x, v)
struct duk_hbuffer_external duk_hbuffer_external
#define DUK_HEAPHDR_SET_TYPE(h, val)
struct duk_hbuffer_fixed duk_hbuffer_fixed
#define DUK_ALLOC_ZEROED(heap, size)
#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap, x, v)
#define DUK_HBUFFER_SET_SIZE(x, v)
#define DUK_HBUFFER_SET_DYNAMIC(x)
#define DUK_BUF_FLAG_NOZERO
#define DUK_BUF_FLAG_DYNAMIC
#define DUK_BUF_FLAG_EXTERNAL
static void error(LoadState *S, const char *why)

◆ duk_hbuffer_get_dynalloc_ptr()

DUK_INTERNAL_DECL void * duk_hbuffer_get_dynalloc_ptr ( duk_heap * heap,
void * ud )

Definition at line 40593 of file duktape-1.5.2/src-noline/duktape.c.

40593 {
40595 }
40596 DUK_HEAP_INSERT_INTO_HEAP_ALLOCATED(heap, &res->hdr);
40597
#define DUK_HEAP_INSERT_INTO_HEAP_ALLOCATED(heap, hdr)

◆ duk_hbuffer_reset()

DUK_INTERNAL_DECL void duk_hbuffer_reset ( duk_hthread * thr,
duk_hbuffer_dynamic * buf )

Definition at line 40672 of file duktape-1.5.2/src-noline/duktape.c.

40672 {
40673 DUK_ASSERT(new_size - prev_size > 0);
40674#ifdef DUK_USE_ZERO_BUFFER_DATA
40675 DUK_MEMZERO((void *) ((char *) res + prev_size),
40676 (duk_size_t) (new_size - prev_size));
40677#endif
40678 }
40679

◆ duk_hbuffer_resize()

DUK_INTERNAL_DECL void duk_hbuffer_resize ( duk_hthread * thr,
duk_hbuffer_dynamic * buf,
duk_size_t new_size )

Definition at line 40615 of file duktape-1.5.2/src-noline/duktape.c.

40632 {
40633 void *res;
40634 duk_size_t prev_size;
40635
40636 DUK_ASSERT(thr != NULL);
40637 DUK_ASSERT(buf != NULL);
40640
40641 /*
40642 * Maximum size check
40643 */
40644
40645 if (new_size > DUK_HBUFFER_MAX_BYTELEN) {
40646 DUK_ERROR_RANGE(thr, "buffer too long");
40647 }
40648
40649 /*
40650 * Note: use indirect realloc variant just in case mark-and-sweep
40651 * (finalizers) might resize this same buffer during garbage
40652 * collection.
40653 */
40654
40655 res = DUK_REALLOC_INDIRECT(thr->heap, duk_hbuffer_get_dynalloc_ptr, (void *) buf, new_size);
40656 if (res != NULL || new_size == 0) {
40657 /* 'res' may be NULL if new allocation size is 0. */
40658
40659 DUK_DDD(DUK_DDDPRINT("resized dynamic buffer %p:%ld -> %p:%ld",
40660 (void *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(thr->heap, buf),
40661 (long) DUK_HBUFFER_DYNAMIC_GET_SIZE(buf),
40662 (void *) res,
40663 (long) new_size));
40664
40665 /*
40666 * The entire allocated buffer area, regardless of actual used
40667 * size, is kept zeroed in resizes for simplicity. If the buffer
40668 * is grown, zero the new part.
40669 */
40670
#define DUK_ERROR_RANGE(thr, msg)
#define DUK_HBUFFER_DYNAMIC_GET_SIZE(x)
#define DUK_REALLOC_INDIRECT(heap, cb, ud, newsize)
DUK_INTERNAL_DECL void * duk_hbuffer_get_dynalloc_ptr(duk_heap *heap, void *ud)
#define DUK_HBUFFER_HAS_EXTERNAL(x)
#define DUK_HBUFFER_HAS_DYNAMIC(x)