| 451 cxBufferDestroy(&buf); |
451 cxBufferDestroy(&buf); |
| 452 return ret; |
452 return ret; |
| 453 } |
453 } |
| 454 |
454 |
| 455 static CxJsonObject json_create_object_map(const CxAllocator *allocator) { |
455 static CxJsonObject json_create_object_map(const CxAllocator *allocator) { |
| 456 CxMap *map = cxKvListCreateAsMap(allocator, (cx_compare_func) cxJsonCompare, CX_STORE_POINTERS); |
456 CxMap *map = cxKvListCreateAsMap(allocator, CX_STORE_POINTERS); |
| 457 if (map == NULL) return NULL; // LCOV_EXCL_LINE |
457 if (map == NULL) return NULL; // LCOV_EXCL_LINE |
| 458 // TODO: fix the specification of the compare function |
458 cxSetCompareFunc(map, cxJsonCompare); |
| 459 map->collection.cmpfunc = (cx_compare_func) cxJsonCompare; |
459 cxSetDestructor(map, cxJsonValueFree); |
| 460 cxDefineDestructor(map, cxJsonValueFree); |
|
| 461 return map; |
460 return map; |
| 462 } |
461 } |
| 463 |
462 |
| 464 static void json_free_object_map(CxJsonObject obj) { |
463 static void json_free_object_map(CxJsonObject obj) { |
| 465 cxMapFree(obj); |
464 cxMapFree(obj); |