Lines Matching refs:global_hooks
169 static internal_hooks global_hooks = {internal_malloc, internal_free, internal_realloc}; variable
190 global_hooks.allocate = malloc; in cJSON_InitHooks()
191 global_hooks.deallocate = free; in cJSON_InitHooks()
192 global_hooks.reallocate = realloc; in cJSON_InitHooks()
196 global_hooks.allocate = malloc; in cJSON_InitHooks()
197 if (hooks->malloc_fn != NULL) global_hooks.allocate = hooks->malloc_fn; in cJSON_InitHooks()
199 global_hooks.deallocate = free; in cJSON_InitHooks()
200 if (hooks->free_fn != NULL) global_hooks.deallocate = hooks->free_fn; in cJSON_InitHooks()
203 global_hooks.reallocate = NULL; in cJSON_InitHooks()
204 …if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) global_hooks.reallocat… in cJSON_InitHooks()
223 …if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) global_hooks.deallocate(item… in cJSON_Delete()
224 …if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) global_hooks.deallocate(item->s… in cJSON_Delete()
225 global_hooks.deallocate(item); in cJSON_Delete()
344 copy = (char *)cJSON_strdup((const unsigned char *)valuestring, &global_hooks); in cJSON_SetValuestring()
894 buffer.hooks = global_hooks; in cJSON_ParseWithLengthOpts()
896 item = cJSON_New_Item(&global_hooks); in cJSON_ParseWithLengthOpts()
999 return (char *)print(item, true, &global_hooks); in cJSON_Print()
1004 return (char *)print(item, false, &global_hooks); in cJSON_PrintUnformatted()
1015 p.buffer = (unsigned char *)global_hooks.allocate((size_t)prebuffer); in cJSON_PrintBuffered()
1022 p.hooks = global_hooks; in cJSON_PrintBuffered()
1025 global_hooks.deallocate(p.buffer); in cJSON_PrintBuffered()
1045 p.hooks = global_hooks; in cJSON_PrintPreallocated()
1575 return add_item_to_object(object, string, item, &global_hooks, false); in cJSON_AddItemToObject()
1581 return add_item_to_object(object, string, item, &global_hooks, true); in cJSON_AddItemToObjectCS()
1588 return add_item_to_array(array, create_reference(item, &global_hooks)); in cJSON_AddItemReferenceToArray()
1595 …return add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, fa… in cJSON_AddItemReferenceToObject()
1601 if (add_item_to_object(object, name, null, &global_hooks, false)) return null; in cJSON_AddNullToObject()
1610 if (add_item_to_object(object, name, true_item, &global_hooks, false)) return true_item; in cJSON_AddTrueToObject()
1619 if (add_item_to_object(object, name, false_item, &global_hooks, false)) return false_item; in cJSON_AddFalseToObject()
1628 if (add_item_to_object(object, name, bool_item, &global_hooks, false)) return bool_item; in cJSON_AddBoolToObject()
1637 if (add_item_to_object(object, name, number_item, &global_hooks, false)) return number_item; in cJSON_AddNumberToObject()
1646 if (add_item_to_object(object, name, string_item, &global_hooks, false)) return string_item; in cJSON_AddStringToObject()
1655 if (add_item_to_object(object, name, raw_item, &global_hooks, false)) return raw_item; in cJSON_AddRawToObject()
1664 if (add_item_to_object(object, name, object_item, &global_hooks, false)) return object_item; in cJSON_AddObjectToObject()
1673 if (add_item_to_object(object, name, array, &global_hooks, false)) return array; in cJSON_AddArrayToObject()
1805 replacement->string = (char *)cJSON_strdup((const unsigned char *)string, &global_hooks); in replace_item_in_object()
1826 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateNull()
1834 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateTrue()
1842 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateFalse()
1850 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateBool()
1858 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateNumber()
1878 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateString()
1881 item->valuestring = (char *)cJSON_strdup((const unsigned char *)string, &global_hooks); in cJSON_CreateString()
1893 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateStringReference()
1904 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateObjectReference()
1915 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateArrayReference()
1926 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateRaw()
1929 item->valuestring = (char *)cJSON_strdup((const unsigned char *)raw, &global_hooks); in cJSON_CreateRaw()
1941 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateArray()
1949 cJSON *item = cJSON_New_Item(&global_hooks); in cJSON_CreateObject()
2087 newitem = cJSON_New_Item(&global_hooks); in cJSON_Duplicate()
2094 newitem->valuestring = (char *)cJSON_strdup((unsigned char *)item->valuestring, &global_hooks); in cJSON_Duplicate()
2098 …StringIsConst) ? item->string : (char *)cJSON_strdup((unsigned char *)item->string, &global_hooks); in cJSON_Duplicate()
2375 return global_hooks.allocate(size); in cJSON_malloc()
2380 global_hooks.deallocate(object); in cJSON_free()