rjd icon indicating copy to clipboard operation
rjd copied to clipboard

rjd_mem_alloc_array: remove or rename

Open rdunnington opened this issue 5 years ago • 0 comments

Some feedback from Chad:

I was confused by the existence of rjd_mem_alloc_array and rjd_array_alloc I think the confusion is between mem_array and array. Which one should I use when? From reading the code it looks like mem_*_array is an implementation detail of the array functions and so it shouldn't be used explicitly.... But I say that with only a cursory glance at the code. Hmm... You could go the other route and have the default mem_alloc require nitems and itemsize like calloc. If a user wants a "block" of generic bytes you could have a mem_alloc_block(numbytes) I like reserving the array keyword for interactions with the dynamic array

rdunnington avatar Dec 01 '20 17:12 rdunnington