Lines Matching refs:global_hooks
147 static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; variable
175 global_hooks.allocate = malloc; in cJSON_InitHooks()
176 global_hooks.deallocate = free; in cJSON_InitHooks()
177 global_hooks.reallocate = realloc; in cJSON_InitHooks()
181 global_hooks.allocate = malloc; in cJSON_InitHooks()
184 global_hooks.allocate = hooks->malloc_fn; in cJSON_InitHooks()
187 global_hooks.deallocate = free; in cJSON_InitHooks()
190 global_hooks.deallocate = hooks->free_fn; in cJSON_InitHooks()
194 global_hooks.reallocate = NULL; in cJSON_InitHooks()
195 if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) in cJSON_InitHooks()
197 global_hooks.reallocate = realloc; in cJSON_InitHooks()
226 global_hooks.deallocate(item->valuestring); in cJSON_Delete()
230 global_hooks.deallocate(item->string); in cJSON_Delete()
232 global_hooks.deallocate(item); in cJSON_Delete()
1017 buffer.hooks = global_hooks; in cJSON_ParseWithOpts()
1019 item = cJSON_New_Item(&global_hooks); in cJSON_ParseWithOpts()
1154 return (char*)print(item, true, &global_hooks); in cJSON_Print()
1159 return (char*)print(item, false, &global_hooks); in cJSON_PrintUnformatted()
1171 p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); in cJSON_PrintBuffered()
1181 p.hooks = global_hooks; in cJSON_PrintBuffered()
1185 global_hooks.deallocate(p.buffer); in cJSON_PrintBuffered()
1206 p.hooks = global_hooks; in cJSON_PrintPreallocated()
1934 add_item_to_object(object, string, item, &global_hooks, false); in cJSON_AddItemToObject()
1940 add_item_to_object(object, string, item, &global_hooks, true); in cJSON_AddItemToObjectCS()
1950 add_item_to_array(array, create_reference(item, &global_hooks)); in cJSON_AddItemReferenceToArray()
1960 add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false); in cJSON_AddItemReferenceToObject()
1966 if (add_item_to_object(object, name, null, &global_hooks, false)) in cJSON_AddNullToObject()
1978 if (add_item_to_object(object, name, true_item, &global_hooks, false)) in cJSON_AddTrueToObject()
1990 if (add_item_to_object(object, name, false_item, &global_hooks, false)) in cJSON_AddFalseToObject()
2002 if (add_item_to_object(object, name, bool_item, &global_hooks, false)) in cJSON_AddBoolToObject()
2014 if (add_item_to_object(object, name, number_item, &global_hooks, false)) in cJSON_AddNumberToObject()
2026 if (add_item_to_object(object, name, string_item, &global_hooks, false)) in cJSON_AddStringToObject()
2038 if (add_item_to_object(object, name, raw_item, &global_hooks, false)) in cJSON_AddRawToObject()
2050 if (add_item_to_object(object, name, object_item, &global_hooks, false)) in cJSON_AddObjectToObject()
2062 if (add_item_to_object(object, name, array, &global_hooks, false)) in cJSON_AddArrayToObject()
2227 replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); in replace_item_in_object()
2248 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateNull()
2259 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateTrue()
2270 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateFalse()
2281 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateBool()
2292 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateNumber()
2318 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateString()
2322 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); in cJSON_CreateString()
2335 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateStringReference()
2347 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateObjectReference()
2357 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateArrayReference()
2368 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateRaw()
2372 item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); in cJSON_CreateRaw()
2385 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateArray()
2396 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateObject()
2563 newitem = cJSON_New_Item(&global_hooks); in cJSON_Duplicate()
2574 … newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); in cJSON_Duplicate()
2582 …N_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); in cJSON_Duplicate()
2926 return global_hooks.allocate(size); in cJSON_malloc()
2931 global_hooks.deallocate(object); in cJSON_free()