# HG changeset patch # User Mike Becker # Date 1688754003 -7200 # Node ID c99abca90d21eff6f91d3da99e3dd9fc9ff6f584 # Parent 937f8b5d4a3f320a8d1805ebc29601065894923d some fixes in example code diff -r 937f8b5d4a3f -r c99abca90d21 docs/src/features.md --- a/docs/src/features.md Fri Jul 07 18:43:11 2023 +0200 +++ b/docs/src/features.md Fri Jul 07 20:20:03 2023 +0200 @@ -46,11 +46,6 @@ alloc.data = calloc(1, sizeof(struct my_allocator_state) + n); return alloc; } - -void free_my_allocator(CxAllocator *alloc) { - free(alloc.data); - free(alloc); -} ``` ## String @@ -133,6 +128,7 @@ // read the file into the buffer and turn it into a string cx_stream_copy(f, content, (cx_read_func) fread, (cx_write_func) cxBufferWrite); + fclose(f); cxstring contentstr = cx_strn(content->space, content->size); // split the string into lines - use the mempool for allocating the target array @@ -235,7 +231,7 @@ cx_list_class const *cl; // The list class definition }; ``` -The actual structure contains one more class pointer that is used when wrapping a list into a pointer aware list +The actual structure contains one more class pointer that is used when wrapping a list into a pointer-aware list with `cxListStorePointers()`. What this means, is that - if you want to implement your own list structure - you only need to cover the case where the list is storing copies of your objects.