4 ms·
So in other words, up to twice the overhead as amount of storage allocated for the actual elements? Yow! This makes this sort of scheme decidedly less attracti
by TheLoneWolfling 11y ago
So in other words, up to twice the overhead as amount of storage allocated for the actual elements? Yow!
This makes this sort of scheme decidedly less attractive.
- kuschku 11y agowell, sometimes you can actually put those bits into the padding, but often you can not. This is how many of the simpler malloc implementations, which do not directly mmap, work. So, remember, if you want to malloc 20 ints, don’t do 20 times malloc(sizeof(int)), do malloc(20*sizeof(int)) and treat them as int[].