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

array_free calling convention is odd. #60

Open
65278 opened this issue Apr 26, 2019 · 0 comments
Open

array_free calling convention is odd. #60

65278 opened this issue Apr 26, 2019 · 0 comments

Comments

@65278
Copy link
Contributor

65278 commented Apr 26, 2019

We already talked a bit about array_free. I think the caller should be responsible for setting pointer to an array to NULL after freeing it, not array_free itself. I think we should keep standard C semantics.

// caller
array_free(replica);
replica = NULL;

And array_free should not accept pointer to a pointer to struct Array as it does now, but just pointer to struct Array (or just Array because of typedef) as other array_* functions:

void
array_free(Array array)

Originally posted by @zilder in #57 (comment)

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