Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: DD/AC3 dropouts with Teletext Plugin



On Thu, Mar 13, 2003 at 12:31:23PM +0100, Klaus Schmidinger wrote:
> "Dr. Werner Fink" wrote:
> > 
> > ...
> >   void cTxtReceiver::Receive(uchar *Data, int Length)
> >   {
> >    uchar *Datai=(uchar *)malloc(Length+60);
> >    memset(Datai,0x00,Length);
> >    memcpy(Datai,Data,Length);
> 
> Just a side note: isn't the memset() superfluous here?

Fully agree ... (and if really needed a calloc call would be
also possible).

Btw:  malloc/free pairs within loops arn't very fast.
IMHO it would be better to alloc an area before any loop only
_once_ and free up if not needed anymore.  If neccessary
it is possible to use realloc to extend that memory area.

      Werner


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index