You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
777 B

name: duk_resize_buffer
proto: |
void *duk_resize_buffer(duk_context *ctx, duk_idx_t index, duk_size_t new_size);
stack: |
[ ... val! ... ]
summary: |
<p>Resize a dynamic buffer at <code>index</code> to <code>new_size</code> bytes.
If <code>new_size</code> is larger than the current size, newly allocated bytes
(above old size) are automatically zeroed. Returns a pointer to the new buffer
data area. If <code>new_size</code> is zero, may return either <code>NULL</code> or some
non-<code>NULL</code> value. If resizing fails, the value at <code>index</code> is not
a dynamic buffer, or <code>index</code> is invalid, throws an error.</p>
example: |
void *ptr;
ptr = duk_resize_buffer(ctx, -3, 4096);
tags:
- stack
- buffer
introduced: 1.0.0