From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: Why malloc() and free() take so much time ? Date: 16 Sep 1999 11:28:19 GMT Organization: Ericsson Erisoft AB, Sweden Message-ID: <7rqk8j$n1d$1@antares.lu.erisoft.se> References: <37E0B563 DOT 67698DE8 AT accord-soft DOT com> NNTP-Posting-Host: propus-144.lu.erisoft.se X-Newsreader: TIN [version 1.2 PL2] Lines: 29 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Sunil V. (sunilv AT accord-soft DOT com) wrote: : This is a multi-part message in MIME format. : --------------6BA90FC783E18B9E6832DC28 : Content-Type: text/plain; charset=us-ascii : Content-Transfer-Encoding: 7bit : Hello Everybody, : A piece of my code looks as follows: : AllocateHugeBlock() : ----- : ----- : ----- : FreeHugeBlock() : "AllocateHugeBlock" allocates 500 blocks each of size 62000 bytes. And : "FreeHugeBlock" frees the same. These two functions are taking most of : my execution time. What I want to know is, whether there is any : workaround for doing the same in a much less time? Perhaps allocate one block of size 500*62000, and then setting up the pointers to point at the right place in the single block? Right, MartinS