]> git.seodisparate.com - SimpleArchiver/commitdiff
Add doc-comment for chunked array init function dev
authorStephen Seo <seo.disparate@gmail.com>
Tue, 22 Apr 2025 03:19:04 +0000 (12:19 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Tue, 22 Apr 2025 03:19:04 +0000 (12:19 +0900)
chunked-array-init should use a no-op cleanup fn if it is only storing
primitive data like integers/floats.

src/data_structures/chunked_array.h

index 164dc789d650643a133b46fd31989318d96d6591..27c23873b97d7b44311ad432e06c7950deb08d0d 100644 (file)
@@ -34,6 +34,9 @@ typedef struct SDArchiverChunkedArr {
     void **array;
 } SDArchiverChunkedArr;
 
+/// Use a no-op elem_cleanup_fn if the element is primitive data like an
+/// integer. If the element has pointers within it, use the cleanup fn to
+/// cleanup the pointers but not the element itself.
 SDArchiverChunkedArr simple_archiver_chunked_array_init(
   void (*elem_cleanup_fn)(void*), uint32_t elem_size);