<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=479201418-21092006><FONT face=Arial
size=2>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial size=2>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. </FONT></SPAN></DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial size=2>Some others of your
questions I have answered in your text below...</FONT></SPAN></DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial
size=2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial
size=2>Markus</FONT></SPAN></DIV>
<DIV><SPAN class=479201418-21092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=479201418-21092006>> </SPAN>Hi,<BR><SPAN
class=479201418-21092006></SPAN><FONT face=Arial size=2>></FONT><BR><SPAN
class=479201418-21092006><FONT face=Arial size=2>> </FONT></SPAN>I haven't
tested the case of playing multiple file one after the other. So<BR><SPAN
class=479201418-21092006>> </SPAN>I didn't "hit" very strongly this
difficulty.<BR><SPAN class=479201418-21092006></SPAN><FONT face=Arial
size=2>></FONT><BR><SPAN class=479201418-21092006><FONT face=Arial
size=2>> </FONT></SPAN>One thing I remember from other past email ou reading
about tremor, is<BR><SPAN class=479201418-21092006>> </SPAN>that the
implementation of the memory fonction of some compiler are not<BR><SPAN
class=479201418-21092006>> </SPAN>working properly or not as supported for
the tremor code. Also, their is<BR><SPAN class=479201418-21092006>>
</SPAN>many variant of malloc and not all compiler support all of them. Did
you<BR><SPAN class=479201418-21092006>> </SPAN>change the version of the
malloc? Did your compiler complained about<BR><SPAN
class=479201418-21092006>> </SPAN>unexisting fonction that you
changed?<BR><SPAN class=479201418-21092006></SPAN><FONT face=Arial
size=2>></FONT></DIV>
<DIV> </DIV>
<DIV><SPAN class=479201418-21092006></SPAN><FONT face=Arial><FONT size=2>R<SPAN
class=479201418-21092006>ight now I didn't change the malloc versions and my
compiler did not complain about anything.</SPAN></FONT></FONT></DIV><FONT
face=Arial><FONT size=2><SPAN class=479201418-21092006></SPAN></FONT></FONT>
<DIV><BR><SPAN class=479201418-21092006>> </SPAN>One of them allocate space
(on the stack I think) and release it<BR><SPAN class=479201418-21092006>>
</SPAN>automaticaly when the fonction that made the allocation return. But
your<BR><SPAN class=479201418-21092006>> </SPAN>leak is in the heap and not
the stack. So if you changed those function if<BR><SPAN
class=479201418-21092006>> </SPAN>your compiler don't support those fonction,
you must release this memory<BR><SPAN class=479201418-21092006>>
</SPAN>yourself.<BR><SPAN class=479201418-21092006></SPAN><FONT face=Arial
size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=479201418-21092006>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.</SPAN></FONT></DIV><FONT face=Arial size=2></FONT>
<DIV><BR><SPAN class=479201418-21092006><FONT face=Arial size=2>>
</FONT></SPAN>So do you changed some fonction or the compiler complained
about<BR><SPAN class=479201418-21092006>> </SPAN>inexisting fonction?</DIV>
<DIV> </DIV>
<DIV><SPAN class=479201418-21092006></SPAN><FONT face=Arial><FONT size=2><SPAN
class=479201418-21092006>Not so far. </SPAN>A<SPAN class=479201418-21092006>s
mentioned above, I am going to replace the malloc-function by the DSP-specific
heap_malloc function which allows me to use several
heaps. </SPAN></FONT></FONT><BR><SPAN class=479201418-21092006></SPAN><FONT
face=Arial size=2>></FONT><BR><SPAN class=479201418-21092006><FONT face=Arial
size=2>> </FONT></SPAN>Frédéric Bastien<BR></DIV></BODY></HTML>