title: How to allocate and free aligned memory in C
body: <p>How do you allocate memory that's aligned to a specific boundary in C (e.g., cache line boundary)?  I'm looking for malloc/free like implementation that ideally would be as portable as possible --- at least between 32 and 64 bit architectures.</p>
  
  <p>Edit to add: In other words, I'm looking for something that would behave like (the now obsolete?) <a href="http://www.mkssoftware.com/docs/man3/memalign.3.asp" rel="noreferrer">memalign</a> function, which can be freed using free.</p>