-
Notifications
You must be signed in to change notification settings - Fork 546
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
Ask for type less often #158
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For instance, the following :
can be rewritten as :
The key difference is that asking for
type
simply to takesizeof(type)
can be error prone (and the errors can be hard to debug) and is redundant when the size of the type can be determined by takingsizeof()
of a variable known to be of the same type in the structure passed to us. It is also sweeter syntax, as an aside.Also, why do we use trust
malloc()
/realloc()
to always succeed ?The text was updated successfully, but these errors were encountered: