[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug in cpcall
- From: Doug Rogers <rogers@...>
- Date: Tue, 11 Mar 2008 09:23:29 -0400
Patrick Donnelly wrote:
> static void *my_Alloc(void *ud, void *ptr, size_t osize, size_t nsize)
> {
> (void) ud;
> if (nsize == 0)
> {
> mem_used -= osize;
> free(ptr);
> return NULL;
> }
> else if (nsize + mem_used > limit)
> return NULL;
> else
> {
> mem_used += nsize;
> return realloc(ptr, nsize);
> }
> }
Don't you want
mem_used += (nsize - osize);
in the last else block?
Doug
--
Innovative Concepts, Inc. www.innocon.com 703-893-2007 x220