February 2026

S M T W T F S
1234567
891011121314
15161718192021
22232425262728

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?