Article View: borland.public.cppbuilder.multimedia
Article #145Re: memory fragmentation
From: Bruce Salzman
Date: Mon, 16 May 2005 15:46
Date: Mon, 16 May 2005 15:46
23 lines
2071 bytes
2071 bytes
>> I suspect this is what is causing your clicks. I statically >> allocate everything on the heap, by defining vast 10 MByte >> structures like this :- > > Actually, if I do create a new buffer every time I need it, then the > clicks disappear. It's just when I re-use one of those buffers that > they come. > >> 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. > > I set the dwBufferLength every time I fill the buffer. Do you "new"/"delete" your buffers? I have found situations where Borland's memory manager returns memory blocks that are improperly aligned (as far as some WinAPI functions are concerned). You might try using GlobalAlloc()/GlobalFree() to see if your clicks go away. Just my $.02. -- Bruce
Technical Details
Message-ID:
<4288c053@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!213.239.142.2.MISMATCH!feeder.xsnews.nl!tudelft.nl!txtfeed2.tudelft.nl!newsfeed.multikabel.nl!gatel-ffm!gatel-ffm!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42851140$1@newsgroups.borland.com> <428861c0@newsgroups.borland.com> <4288899b@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 From: " Bruce Salzman" <bruce@nospam.org> Newsgroups: borland.public.cppbuilder.multimedia References: <42851140$1@newsgroups.borland.com> <428861c0@newsgroups.borland.com> <4288899b@newsgroups.borland.com> Subject: Re: memory fragmentation Date: Mon, 16 May 2005 10:46:28 -0500 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 67.52.3.150 Message-ID: <4288c053@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1116258387 67.52.3.150 (16 May 2005 08:46:27 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!213.239.142.2.MISMATCH!feeder.xsnews.nl!tudelft.nl!txtfeed2.tudelft.nl!newsfeed.multikabel.nl!gatel-ffm!gatel-ffm!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail