<br><br><div class="gmail_quote">On Sat, Oct 16, 2010 at 6:41 AM, lieven moors <span dir="ltr"><<a href="mailto:lievenmoors@gmail.com">lievenmoors@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">On Sat, Oct 16, 2010 at 11:06:19AM +0200, Jens M Andreasen wrote:<br>
> What you can do is, take an existing implementation and preallocate a<br>
> fixed number of objects in a linked list, like a stack. Then you pop off<br>
> the first object whereever there is a malloc() and push it on again<br>
> whereever there is a free()<br>
><br>
><br>
<br>
</div>Hi Jens,<br>
<br>
Thanks for the suggestion! That sounds exactly like what<br>
I want to do.<br>
<br>
Though I still wonder if there are any existing implementations<br>
out there that use the stack directly...<br>
<br>
Greetings,<br>
<font color="#888888"><br>
Lieven<br>
</font><div><div></div><div class="h5"><br>
<br>
> On Sat, 2010-10-16 at 00:35 +0200, Lieven Moors wrote:<br>
> > Hi everyone,<br>
> ><br>
> > I am looking for a self balancing binary tree implementation<br>
> > in C or C++ that I can use in the JACK proces callback.<br>
> > I was thinking about something like multiset in c++ (equal keys allowed),<br>
> > but that doesn't use dynamic memory allocation.<br>
> ><br>
> > Thanks for your help<br>
> ><br>
> > Greetings,<br>
> ><br>
> > Lieven<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Linux-audio-dev mailing list<br>
> > <a href="mailto:Linux-audio-dev@lists.linuxaudio.org">Linux-audio-dev@lists.linuxaudio.org</a><br>
> > <a href="http://lists.linuxaudio.org/listinfo/linux-audio-dev" target="_blank">http://lists.linuxaudio.org/listinfo/linux-audio-dev</a><br>
> --<br>
> eins, zwei, drei ... tekno tekno??<br>
><br>
> <a href="http://www.youtube.com/watch?v=ZEgbW1FxR78" target="_blank">http://www.youtube.com/watch?v=ZEgbW1FxR78</a><br>
><br>
<br>
<br>
_______________________________________________<br>
Linux-audio-dev mailing list<br>
<a href="mailto:Linux-audio-dev@lists.linuxaudio.org">Linux-audio-dev@lists.linuxaudio.org</a><br>
<a href="http://lists.linuxaudio.org/listinfo/linux-audio-dev" target="_blank">http://lists.linuxaudio.org/listinfo/linux-audio-dev</a><br>
</div></div></blockquote></div><br><br>Hi, I'm not sure if this will help you, but I wrote a fixed block size memory allocator which is really simple for the TI89 calculator.  I wrote it a while ago, and I think I'm the only one who's actually used it till now, so it's not well tested, but it's available on google code: <a href="http://code.google.com/p/lardalloc/">http://code.google.com/p/lardalloc/</a>  It should fit your requirements, as it just uses the free blocks to implement a stack, and thus is really fast.  The only problem you might encounter is that because implemented for a graphing calculator, it is limited to 2^16 blocks maximum.  I wouldn't expect it to cause any problems running on a non-calculator platform, because it is written in standard C.  Again, you'd still have to write a tree implementation on top of it.<br>

<br>Jeremy<br>