tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: aligned_alloc c11 function
>>> but a purist might want to use compile-time log2 macros to compute
>>> MIN_ALIGNMENT.)
>> How does one do that? [...]
> Using ?: for a binary search comes to mind.
You have to put a hard maximum on the result for that to work, no?
That is, you have to assume that the thing you want to take lg of
(sizeof(void *), in ths case) is not greater than some maximum value, a
maximum which cannot be raised without hacking on the source.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse%rodents-montreal.org@localhost
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
Home |
Main Index |
Thread Index |
Old Index