Lines Matching refs:global_hooks
193 static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; variable
221 global_hooks.allocate = malloc; in cJSON_InitHooks()
222 global_hooks.deallocate = free; in cJSON_InitHooks()
223 global_hooks.reallocate = realloc; in cJSON_InitHooks()
227 global_hooks.allocate = malloc; in cJSON_InitHooks()
230 global_hooks.allocate = hooks->malloc_fn; in cJSON_InitHooks()
233 global_hooks.deallocate = free; in cJSON_InitHooks()
236 global_hooks.deallocate = hooks->free_fn; in cJSON_InitHooks()
240 global_hooks.reallocate = NULL; in cJSON_InitHooks()
241 if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) in cJSON_InitHooks()
243 global_hooks.reallocate = realloc; in cJSON_InitHooks()
272 global_hooks.deallocate(item->valuestring); in cJSON_Delete()
276 global_hooks.deallocate(item->string); in cJSON_Delete()
278 global_hooks.deallocate(item); in cJSON_Delete()
420 copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks); in cJSON_SetValuestring()
1117 buffer.hooks = global_hooks; in cJSON_ParseWithLengthOpts()
1119 item = cJSON_New_Item(&global_hooks); in cJSON_ParseWithLengthOpts()
1259 return (char*)print(item, true, &global_hooks); in cJSON_Print()
1264 return (char*)print(item, false, &global_hooks); in cJSON_PrintUnformatted()
1276 p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); in cJSON_PrintBuffered()
1286 p.hooks = global_hooks; in cJSON_PrintBuffered()
1290 global_hooks.deallocate(p.buffer); in cJSON_PrintBuffered()
1311 p.hooks = global_hooks; in cJSON_PrintPreallocated()
2056 return add_item_to_object(object, string, item, &global_hooks, false); in cJSON_AddItemToObject()
2062 return add_item_to_object(object, string, item, &global_hooks, true); in cJSON_AddItemToObjectCS()
2072 return add_item_to_array(array, create_reference(item, &global_hooks)); in cJSON_AddItemReferenceToArray()
2082 …return add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, fa… in cJSON_AddItemReferenceToObject()
2088 if (add_item_to_object(object, name, null, &global_hooks, false)) in cJSON_AddNullToObject()
2100 if (add_item_to_object(object, name, true_item, &global_hooks, false)) in cJSON_AddTrueToObject()
2112 if (add_item_to_object(object, name, false_item, &global_hooks, false)) in cJSON_AddFalseToObject()
2124 if (add_item_to_object(object, name, bool_item, &global_hooks, false)) in cJSON_AddBoolToObject()
2136 if (add_item_to_object(object, name, number_item, &global_hooks, false)) in cJSON_AddNumberToObject()
2148 if (add_item_to_object(object, name, string_item, &global_hooks, false)) in cJSON_AddStringToObject()
2160 if (add_item_to_object(object, name, raw_item, &global_hooks, false)) in cJSON_AddRawToObject()
2172 if (add_item_to_object(object, name, object_item, &global_hooks, false)) in cJSON_AddObjectToObject()
2184 if (add_item_to_object(object, name, array, &global_hooks, false)) in cJSON_AddArrayToObject()
2355 replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); in replace_item_in_object()
2374 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateNull()
2385 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateTrue()
2396 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateFalse()
2407 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateBool()
2418 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateNumber()
2444 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateString()
2448 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); in cJSON_CreateString()
2461 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateStringReference()
2473 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateObjectReference()
2483 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateArrayReference()
2494 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateRaw()
2498 item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); in cJSON_CreateRaw()
2511 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateArray()
2522 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateObject()
2689 newitem = cJSON_New_Item(&global_hooks); in cJSON_Duplicate()
2700 … newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); in cJSON_Duplicate()
2708 …N_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); in cJSON_Duplicate()
3079 return global_hooks.allocate(size); in cJSON_malloc()
3084 global_hooks.deallocate(object); in cJSON_free()