[PD-dev] d_soundfile.c MAXBUFSIZE

Miller Puckette mpuckett at imusic1.ucsd.edu
Tue Feb 28 19:29:34 CET 2006

On some OSes (I needn't name names:) the system can hang if one asks
to malloc too much space.  This was a major cause of headaches for
people trying to use Pd to read large soundfiles.  Anyway, as you already
found, this doesn't affect the "soundfiler" object which has a settable


On Tue, Feb 28, 2006 at 11:54:39AM +0000, David Plans Casal wrote:
> Hello everyone,
> Would someone be able to explain to me why d_soundfile.c has the  
> following buffer size allocation?
> #define MAXBUFSIZE 16777216 	/* arbitrary; just don't want to hang  
> malloc */
> I'm not sure about the 'hanging malloc' thing...does it mean that  
> enlarging that buffer size could screw with memory allocation because  
> it we might 'run out'?
> AFAICT, 16777216 is about 6.3 minutes. If I need more like 26460000  
> (10m) allocation, could I just alter MAXBUFSIZE and recompile? Or is  
> there a saner way of doing it, so that I don't end up with a 'custom'  
> pd?
> d
> --
> David Plans Casal
> Researcher, UEA Studios
> d.casal at uea dot ac dot uk
> http://www.davidcasal.com
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev

More information about the Pd-dev mailing list