Josh Rosenberg added the comment:

Additional comment on clarity: Might it make sense to make the calloc structure 
member take both the num and size arguments that the underlying calloc takes? 
That is, instead of:

void* (*calloc) (void *ctx, size_t size);

Declare it as:

void* (*calloc) (void *ctx, size_t num, size_t size);

Beyond potentially allowing more detailed tracing info at some later point (and 
much like the original calloc, potentially allowing us to verify that the 
components do not overflow on multiply, instead of assuming every caller must 
multiply and check for themselves), it also seems like it's a bit more friendly 
to have the prototype for the structure calloc to follow the same pattern as 
the other members for consistency (Principle of Least Surprise): A context 
pointer, plus the arguments expected by the equivalent C function.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21233>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to