# HeapBlock and over-aligned memory

**URL:** <https://forum.juce.com/t/heapblock-and-over-aligned-memory/14473>\
**Category:** General JUCE discussion\
**Created:** [March 17, 2015, 11:01am UTC](https://forum.juce.com/t/heapblock-and-over-aligned-memory/14473 "2015-03-17T11:01:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robclouth](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@robclouth](https://forum.juce.com/u/robclouth)\
**Post date:** [March 17, 2015, 11:01am UTC](https://forum.juce.com/t/heapblock-and-over-aligned-memory/14473/1 "2015-03-17T11:01:02Z")

</div>

Hi guys,

I'm using FFTS, an FFT library that requires memory to be over-aligned with&nbsp;\_aligned\_malloc. I'd like to use&nbsp;HeapBlock with this so I don't need to keep track of the things. Is this as simple as subclassing HeapBlock and overriding any mallocy methods with \_aligned\_mallocy ones?

Cheers,

&nbsp;

Rob

---

<div class="post-metadata">

**Author:** ![robclouth](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@robclouth](https://forum.juce.com/u/robclouth)\
**Post date:** [March 17, 2015, 11:11am UTC](https://forum.juce.com/t/heapblock-and-over-aligned-memory/14473/2 "2015-03-17T11:11:26Z")

</div>

In fact I might just tweak the HeapBlock code to add an alignment thingy.

---

<div class="post-metadata">

**Author:** ![andrewj](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/andrewj/32/13428_2.png) [@andrewj](https://forum.juce.com/u/andrewj)\
**Post date:** [March 17, 2015, 12:01pm UTC](https://forum.juce.com/t/heapblock-and-over-aligned-memory/14473/3 "2015-03-17T12:01:13Z")

</div>

Fyi&nbsp;- see&nbsp;http://www.juce.com/forum/topic/alignment-audiosamplebuffers

BTW I saw you posting issues on GitHub about ffts. Did you get it playing nicely in MSVC using that other repo? &nbsp;And have you considered gift wrapping ffts as a juce module :)

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [March 19, 2015, 11:36am UTC](https://forum.juce.com/t/heapblock-and-over-aligned-memory/14473/4 "2015-03-19T11:36:56Z")

</div>

\*laughs\* Gift Wrapping :)&nbsp;

I'm waiting for the horses-mouth installation tool myself...

---

<div class="post-metadata">

**Author:** ![lucb](https://avatars.discourse-cdn.com/v4/letter/l/5e9695/32.png) [@lucb](https://forum.juce.com/u/lucb)\
**Post date:** [September 17, 2021, 9:37pm UTC](https://forum.juce.com/t/heapblock-and-over-aligned-memory/14473/5 "2021-09-17T21:37:57Z")

</div>

Hi. Thanks very much for your help. I rewrite my code without arrays and other modifications and it worked.  
Regards. LucB
