[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA-dev: PCB MyFree



DJ -

On Thu, Jun 22, 2006 at 09:04:40AM -0400, DJ Delorie wrote:
> It would be better to rename the function, and have the macro called
> MyFree()

I thought about that, and didn't like changing the semantics
without changing the name.  A change from MyFree(&foo) to
MyFree(foo) would be bothersome to untangle if a change was
half-applied.

My patch removed the MyFree() function entirely.  The macro
MYFREE now calls an unmodified SaveFree().

> For extra credit, have the macro pass __FUNCTION__ and __LINE__ to
> MyFree_2() (or whatever) and add useful diagnostics.  Similarly for
> MyCalloc and MyAlloc.

My goal was to improve things with minimally invasive changes.

> Bonus if the new macros are called malloc() and free() :-)

Umm.  That would confuse me.

There is already a hook to use <dmalloc.h>.  Surely they do
all this better than we do.  Would it be better to drop all
this stuff, and go back to the raw (possibly dmalloc-ified)
malloc() and free()?

   - Larry
_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev