3 ms·
I ran into a great alloca bug back in the early days, think 2001 of OS X. Used alloca to allocate a string on the stack. Depending on the size of the string t
by chollida1 7y ago
I ran into a great alloca bug back in the early days, think 2001 of OS X.
Used alloca to allocate a string on the stack. Depending on the size of the string the colours on the dialog would either look normal or have a rainbow like colour.
Turns out that alloca allocated the data on a non aligned memory address on occasion this caused the quartz compositor, which depended on aligned memory, to draw text with goofy colours.
Moral of the story, I don't use alloca anymore and if I do, I ensure that its aligned properly.