Re: HeapAlloc()

new topic     » topic index » view thread      » older message » newer message

----- Original Message -----
From: "Wolf" <wolfritz at KING.IGS.NET>
To: "EUforum" <EUforum at topica.com>
Subject: Re: HeapAlloc()


>
> > Wolf,
> > I'm using this in win32lib. That means that every acquire_mem() call
will
> > return a pointer to zeroed memory. There is no need for a mem_set() call
> > unless you are clearing memory that you have already used after an
> > acquire_mem() call.
> >
> > Are you suggesting that I should not be using HEAP_ZERO_MEMORY?
>
> Not at all.
> ... you were using HEAP_ZERO_MEMORY, as well as mem_set(), to zero it
> *again*, in every acquire_mem() ?
>

Ooops! I'll fix that right now!

I figure it got this way 'cos originally the acquire_mem used the Euphoria
allocate() then later I changed it to HeapAlloc and forgot about removing
the extra clearing operation.

I've also added a possible performance thing for Windows NT/2000/XP users.
After every 100 HeapFree calls, I call the HeapCompact routine. The '100' is
adjustable by the user. For Windows 95/98/Me users, this has no effect
because Microsoft didn't implement it for  that platform family.




----------------
cheers,
Derek Parnell

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu