Info-Mac Archive Downloads: dev/src/ SourceCode

Back to dev/src/ SourceCode

Re: [Source] Here's my own operator new for CW (custom-new-cp.hqx)

Download custom-new-cp.hqx (5,883 KB)


Date: Sun, 04 Dec 1994 00:32:51 -0500
From: pottier@fregate.ens.fr
Subject: Re: [Source] Here's my own operator new for CW

Recently I rewrote my own implementation of the new and delete
operators (under CodeWarrior 4.5). My own implementations have
the main two following advantages over the standard ones:

- They can take memory from the temporary zone if the application
heap is full
- They release memory to the OS when it isn't needed any more

I like this behavior better than the standard one, because it allows
me to give an average-sized heap to my application and yet still be
able to handle big tasks requiring unusual amounts of memory.

I thought I'd share my code with the rest of the world, so here it
is. I have binhexed it to preserve the font settings (it's more than
80 columns anyway).

Let me know if you think the idea can be improved, or if you have
good reasons why it isn't a good idea!

Cheers,

Francois Pottier pottier@dmi.ens.fr