[vlc-devel] [PATCH] access: dvb: Realloc block to actually used size.

Rémi Denis-Courmont remi at remlab.net
Tue Sep 24 22:47:20 CEST 2013


Le mardi 24 septembre 2013 15:44:49 Julian Scheel a écrit :
> Am 24.09.2013 15:07, schrieb Rémi Denis-Courmont:
> > On Tue, 24 Sep 2013 14:59:02 +0200, Julian Scheel <julian at jusst.de> wrote:
> >> The realloc caused packet loss?
> > 
> > The performance problem caused packet loss and reallocation contributes to
> > it.
> > 
> >> Why that?
> > 
> > Reallocation requires memory copying in most cases, and extra heap
> > processing.
> 
> Shouldn't a good realloc implementation be able to just free left over
> memory without copying everything, as long as the target size is less
> than the original size?

I'm not an expert in heap algorithms, but I would hazard a "no" if only to 
stay on the safe side.

(...)
> Ok, so the issue you describes exists with the current UDP access
> module? I have not seen it myself running on not actually powerful systems.

It was presumably worked around (in a rather ugly and inefficient way) recently.

> What would you think about the approach we discussed before where we
> allocate memory dynamically due to previous readback size?

I do not know the issue in sufficient details to determine what work around 
would really work and what not. Someone should investigate it (I think Steinar 
did some on TCP already) and fix the performance problem for _real_.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list