Closed jleffler closed 3 years ago
Looks like this member is never used anywhere else. Removing it would change the size of the struct csv_parser
, though, and perhaps break existing code if using libcsv
as a pre-built library. If used strictly as a source-code library, then removing it shouldn't break anything.
(EDIT: Don't know what I was thinking concerning removing the realloc_func
... obviously, the user can set this after calling csv_init()
to a different function.)
Thanks @jleffler for pointing out the unused malloc_func
member. I think this is probably a holdover from before realloc_func
was used for all allocations. Since removing this member would break ABI-compatibility with the current version (as @bobhairgrove noted) I would be hesitant to make that change in 3.x. If the next release does not introduce another ABI-breaking change we can certainly add a note indicating that this member is not used until it is removed.
Unless I've missed something, it would be possible (and trivial) to remove the
malloc_func
element ofstruct csv_parser
. Apart from documentation, only thecsv.h
header and thelibcsv.c
file would be changed. The header would lose the line formalloc_func
. Thecsv_init()
function would lose the line that sets the element to a null pointer.