MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / create_mspace_with_base

Function create_mspace_with_base

system/lib/dlmalloc.c:5543–5555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5541}
5542
5543mspace create_mspace_with_base(void* base, size_t capacity, int locked) {
5544 mstate m = 0;
5545 size_t msize;
5546 ensure_initialization();
5547 msize = pad_request(sizeof(struct malloc_state));
5548 if (capacity > msize + TOP_FOOT_SIZE &&
5549 capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
5550 m = init_user_mstate((char*)base, capacity);
5551 m->seg.sflags = EXTERN_BIT;
5552 set_lock(m, locked);
5553 }
5554 return (mspace)m;
5555}
5556
5557int mspace_track_large_chunks(mspace msp, int enable) {
5558 int ret = 0;

Callers

nothing calls this directly

Calls 1

init_user_mstateFunction · 0.85

Tested by

no test coverage detected