🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #139

Re: memory fragmentation

#139
From: Mark Jacobs
Date: Mon, 16 May 2005 09:03
24 lines
1723 bytes
Jonathan Benedicto wrote:
> Would allocating new 8192 byte wave buffers every 1/4 second affect a 
> computer's performance significantly ? I mean, if I kept allocating 
> and freeing those buffers, would excessive RAM fragmentation result ?
> 
> Jonathan
>  
> 
> 
I suspect this is what is causing your clicks. I statically allocate 
everything on the heap, by defining vast 10 MByte structures like this :-

#define BFLIM 100001
#define NBFS 100
char wvbfr[NBFS][BFLIM];
WAVEHDR wvhd[NBFS];

Also, are you using the correct lengths?  If you are using OGG format, every 
1/4 second buffer will be a different length to the next. The member 
wvhd[nxtbf].dwBufferLength must be set correctly each time.

-- 
Mark Jacobs
http://www.dkcomputing.co.uk
Technical Details
Message-ID: <428861c0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42851140$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,6e41daf58c14cc3a
X-Google-Attributes: gid10d0fc,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 16 May 2005 10:03:47 +0100
From: Mark Jacobs <http://www.jacobsm.com/mjmsg.htm?mj@critical>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.multimedia
Subject: Re: memory fragmentation
References: <42851140$1@newsgroups.borland.com>
In-Reply-To: <42851140$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.144.157.8
Message-ID: <428861c0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116234176 81.144.157.8 (16 May 2005 02:02:56 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail