3 ms·
Dumb question but do you have to do anything manually to ensure it’s actually aligned to a single cache line or does it just happen because of the way things wo
by zamadatix 4y ago
Dumb question but do you have to do anything manually to ensure it’s actually aligned to a single cache line or does it just happen because of the way things work?
- stagger87 4y agoNot a dumb question. In theory, yes you want it to be aligned for performance reasons, and you can do this with one of the _aligned_malloc()/aligned_alloc() variants. In reality though, for any non-trivial algorithm, you may not be able to always enforce this.
- sylware 4y agoUsually you alloc some slack memory to be able to re-align on a cache line. But yeah, it seems better if the allocator can cleanely deal with that.