Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rjd_mem_alloc_array: remove or rename #33

Open
rdunnington opened this issue Dec 1, 2020 · 0 comments
Open

rjd_mem_alloc_array: remove or rename #33

rdunnington opened this issue Dec 1, 2020 · 0 comments

Comments

@rdunnington
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant