MCPcopy Create free account
hub / github.com/HumbleNet/HumbleNet / json_alloc

Function json_alloc

3rdparty/json-parser/json.c:88–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88static void * json_alloc (json_state * state, unsigned long size, int zero)
89{
90 if ((state->ulong_max - state->used_memory) < size)
91 return 0;
92
93 if (state->settings.max_memory
94 && (state->used_memory += size) > state->settings.max_memory)
95 {
96 return 0;
97 }
98
99 return state->settings.mem_alloc (size, zero, state->settings.user_data);
100}
101
102static int new_value (json_state * state,
103 json_value ** top, json_value ** root, json_value ** alloc,

Callers 1

new_valueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected