This section of the archives stores flipcode's complete Developer Toolbox collection,
featuring a variety of mini-articles and source code contributions from our readers.

Aligned Block Allocation
Submitted by

In MSVC 6.0 SP4 MS introduced the processor pack. This allowed use of MMX,
3DNow, SSE & SSE2 intrinsics via standard 'C'. While the intrinsics them
self are not that interesting, the _aligned_malloc and __aligned_free are.
This COTD is an STL like allocator that uses these new malloc & free
functions. As a bonus, I added T_BLOCKSIZE to add extra padding at the end
of the vector. This allows complete reg (mmreg/xmmreg) loads & stores
without the worry of overwriting array bounds.