MCPcopy Create free account
hub / github.com/cppla/ServerStatus / json_alloc

Function json_alloc

server/src/json.c:89–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

new_valueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected