Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
duktape-1.5.2/src-separate/duk_api_buffer.c
Go to the documentation of this file.
1/*
2 * Buffer
3 */
4
5#include "duk_internal.h"
6
8 duk_hthread *thr = (duk_hthread *) ctx;
10
12
14 DUK_ASSERT(h != NULL);
15
18 }
19
20 /* maximum size check is handled by callee */
21 duk_hbuffer_resize(thr, h, new_size);
22
24}
25
27 duk_hthread *thr = (duk_hthread *) ctx;
29 void *ptr;
30 duk_size_t sz;
31
32 DUK_ASSERT(ctx != NULL);
33
35 DUK_ASSERT(h != NULL);
36
39 }
40
41 /* Forget the previous allocation, setting size to 0 and alloc to
42 * NULL. Caller is responsible for freeing the previous allocation.
43 * Getting the allocation and clearing it is done in the same API
44 * call to avoid any chance of a realloc.
45 */
48 if (out_size) {
49 *out_size = sz;
50 }
53
54 return ptr;
55}
56
guint index
#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap, x)
#define DUK_ASSERT_CTX_VALID(ctx)
DUK_INTERNAL_DECL void duk_hbuffer_resize(duk_hthread *thr, duk_hbuffer_dynamic *buf, duk_size_t new_size)
#define DUK_HBUFFER_DYNAMIC_GET_SIZE(x)
#define DUK_ERROR_TYPE(thr, msg)
#define DUK_HBUFFER_EXTERNAL_SET_SIZE(x, v)
DUK_INTERNAL_DECL duk_hbuffer * duk_require_hbuffer(duk_context *ctx, duk_idx_t index)
#define DUK_STR_WRONG_BUFFER_TYPE
#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap, x, v)
#define DUK_HBUFFER_DYNAMIC_SET_SIZE(x, v)
#define DUK_HBUFFER_HAS_EXTERNAL(x)
#define DUK_HBUFFER_HAS_DYNAMIC(x)
#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL(heap, x)
DUK_EXTERNAL void * duk_steal_buffer(duk_context *ctx, duk_idx_t index, duk_size_t *out_size)
DUK_EXTERNAL void * duk_resize_buffer(duk_context *ctx, duk_idx_t index, duk_size_t new_size)
DUK_EXTERNAL void duk_config_buffer(duk_context *ctx, duk_idx_t index, void *ptr, duk_size_t len)
#define NULL
Definition gmacros.h:924