March 2026

S M T W T F S
12 34567
891011121314
151617 18192021
22232425262728
293031    

Page Summary

Style Credit

Expand Cut Tags

No cut tags

January 26th, 2016

stas: (Default)
Tuesday, January 26th, 2016 04:26 pm
So, you've got a code in C that needs to allocate X objects of size Y. So, you start with malloc(X*Y). Then you discover X*Y may produce overflow, so you make function alloc(X, Y) that checks for overflows.

And then of course everybody starts using it as alloc(1, X*Y). Because it's the same thing, right?