return loader_alloc(pAllocator, size, VK_SYSTEM_ALLOCATION_SCOPE_COMMAND);
}
+void *cJSON_malloc_instance_scope(const VkAllocationCallbacks *pAllocator, size_t size) {
+ return loader_alloc(pAllocator, size, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+}
+
void cJSON_Free(const VkAllocationCallbacks *pAllocator, void *pMemory) { loader_free(pAllocator, pMemory); }
/*
if (p)
out = ensure(pAllocator, p, out_buf_size);
else
- out = (char *)cJSON_malloc(pAllocator, out_buf_size);
+ out = (char *)cJSON_malloc_instance_scope(pAllocator, out_buf_size);
if (!out) return 0;
ptr2 = out;
// *ptr2++ = '\"'; // Modified to not put quotes around the string
if (p)
out = ensure(pAllocator, p, out_buf_size);
else
- out = (char *)cJSON_malloc(pAllocator, out_buf_size);
+ out = (char *)cJSON_malloc_instance_scope(pAllocator, out_buf_size);
if (!out) return 0;
strcpy(out, "\"\"");
return out;
if (p)
out = ensure(pAllocator, p, out_buf_size);
else
- out = (char *)cJSON_malloc(pAllocator, out_buf_size);
+ out = (char *)cJSON_malloc_instance_scope(pAllocator, out_buf_size);
if (!out) return 0;
ptr2 = out;
if (NULL != file) {
fclose(file);
}
+ if (res != VK_SUCCESS && *json != NULL) {
+ cJSON_Delete(*json);
+ *json = NULL;
+ }
return res;
}