Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1795,14 +1795,14 @@ JSRuntime *JS_NewRuntime2(const JSMallocFunctions *mf, void *opaque)
rt = mf->js_calloc(opaque, 1, sizeof(JSRuntime));
if (!rt)
return NULL;
/* Inline what js_malloc_rt does since we cannot use it here. */
ms.malloc_count++;
ms.malloc_size += mf->js_malloc_usable_size(rt) + MALLOC_OVERHEAD;
rt->mf = *mf;
if (!rt->mf.js_malloc_usable_size) {
/* use dummy function if none provided */
rt->mf.js_malloc_usable_size = js_malloc_usable_size_unknown;
}
/* Inline what js_malloc_rt does since we cannot use it here. */
ms.malloc_count++;
ms.malloc_size += rt->mf.js_malloc_usable_size(rt) + MALLOC_OVERHEAD;
rt->malloc_state = ms;
rt->malloc_gc_threshold = 256 * 1024;

Expand Down
Loading