Lines Matching refs:global_hooks
198 static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc };
226 global_hooks.allocate = malloc;
227 global_hooks.deallocate = free;
228 global_hooks.reallocate = realloc;
232 global_hooks.allocate = malloc;
235 global_hooks.allocate = hooks->malloc_fn;
238 global_hooks.deallocate = free;
241 global_hooks.deallocate = hooks->free_fn;
245 global_hooks.reallocate = NULL;
246 if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free))
248 global_hooks.reallocate = realloc;
277 global_hooks.deallocate(item->valuestring);
282 global_hooks.deallocate(item->string);
289 global_hooks.deallocate(item);
579 copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks);
1355 buffer.hooks = global_hooks;
1357 item = cJSON_New_Item(&global_hooks);
1497 return (char*)print(item, true, &global_hooks);
1502 return (char*)print(item, false, &global_hooks);
1514 p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer);
1524 p.hooks = global_hooks;
1528 global_hooks.deallocate(p.buffer);
1549 p.hooks = global_hooks;
2298 return add_item_to_object(object, string, item, &global_hooks, false);
2304 return add_item_to_object(object, string, item, &global_hooks, true);
2314 return add_item_to_array(array, create_reference(item, &global_hooks));
2324 return add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false);
2330 if (add_item_to_object(object, name, null, &global_hooks, false))
2342 if (add_item_to_object(object, name, true_item, &global_hooks, false))
2354 if (add_item_to_object(object, name, false_item, &global_hooks, false))
2366 if (add_item_to_object(object, name, bool_item, &global_hooks, false))
2379 if (add_item_to_object(object, name, int_item, &global_hooks, false))
2392 if (add_item_to_object(object, name, number_item, &global_hooks, false))
2404 if (add_item_to_object(object, name, string_item, &global_hooks, false))
2416 if (add_item_to_object(object, name, raw_item, &global_hooks, false))
2428 if (add_item_to_object(object, name, object_item, &global_hooks, false))
2440 if (add_item_to_object(object, name, array, &global_hooks, false))
2630 replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2654 cJSON *item = cJSON_New_Item(&global_hooks);
2665 cJSON *item = cJSON_New_Item(&global_hooks);
2676 cJSON *item = cJSON_New_Item(&global_hooks);
2687 cJSON *item = cJSON_New_Item(&global_hooks);
2699 cJSON *item = cJSON_New_Item(&global_hooks);
2714 cJSON *item = cJSON_New_Item(&global_hooks);
2741 cJSON *item = cJSON_New_Item(&global_hooks);
2768 cJSON *item = cJSON_New_Item(&global_hooks);
2772 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2785 cJSON *item = cJSON_New_Item(&global_hooks);
2797 cJSON *item = cJSON_New_Item(&global_hooks);
2807 cJSON *item = cJSON_New_Item(&global_hooks);
2818 cJSON *item = cJSON_New_Item(&global_hooks);
2822 item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks);
2835 cJSON *item = cJSON_New_Item(&global_hooks);
2846 cJSON *item = cJSON_New_Item(&global_hooks);
3030 newitem = cJSON_New_Item(&global_hooks);
3041 newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks);
3049 newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks);
3458 return global_hooks.allocate(size);
3463 global_hooks.deallocate(object);