Author josh.r
Recipients josh.r, neologix, njs, pitrou, skrah, vstinner
Date 2014-04-15.22:17:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397600239.11.0.927751332388.issue21233@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-04-15 22:17:19josh.rsetrecipients: + josh.r, pitrou, vstinner, njs, skrah, neologix
2014-04-15 22:17:19josh.rsetmessageid: <1397600239.11.0.927751332388.issue21233@psf.upfronthosting.co.za>
2014-04-15 22:17:19josh.rlinkissue21233 messages
2014-04-15 22:17:18josh.rcreate