Email Correspondence to following topic: [Tremor] Question to memory leaks in Tremor

Lorber, Markus markus.lorber at siemens.com
Thu Sep 21 11:41:42 PDT 2006


Hello,
 
right now I do the following: I did't change any of the malloc- or calloc- functions. I just clear the heap right after calling the ov_clear() by a Blackfin specific function called heap_init(). This ensures there are no heap leaks when starting playback for the next file. But this solution is only a one channel solution as the whole heap is cleared.
 
My next step will be using multiple heaps for each OggVorbis channel. On the Blackfin-DSP this can be done. For doing this I will have to  replace all malloc-functions by Blackfin specific heap_malloc functions. They do the same as the standard malloc, but they have an extra parameter which is the heap-index. So in my solution each OggVorbis Channel has its own heap indicated by its heap-index. If clearing the heap for one channel, the heap of an other channel is not affected. 
 
Some others of your questions I have answered in your text below...
 
Regards,
Markus
 
> Hi,
>
> I haven't tested the case of playing multiple file one after the other. So
> I didn't "hit" very strongly this difficulty.
>
> One thing I remember from other past email ou reading about tremor, is
> that the implementation of the memory fonction of some compiler are not
> working properly or not as supported for the tremor code. Also, their is
> many variant of malloc and not all compiler support all of them. Did you
> change the version of the malloc? Did your compiler complained about
> unexisting fonction that you changed?
>
 
Right now I didn't change the malloc versions and my compiler did not complain about anything.

> One of them allocate space (on the stack I think) and release it
> automaticaly when the fonction that made the allocation return. But your
> leak is in the heap and not the stack. So if you changed those function if
> your compiler don't support those fonction, you must release this memory
> yourself.
>
I think you mean the alloca functions, which allocates memory on the stack. This function caused problems only in the beginning when my stack-size was to small. But with an increased stack-size the alloca doesn't cause problems anymore.

> So do you changed some fonction or the compiler complained about
> inexisting fonction?
 
Not so far. As mentioned above, I am going to replace the malloc-function by the DSP-specific heap_malloc function which allows me to use several heaps. 
>
> Frédéric Bastien

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/tremor/attachments/20060921/34436ac9/attachment.htm


More information about the Tremor mailing list