[Top][All Lists]

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


From: Gary V . Vaughan
Subject: Re:
Date: Wed, 31 Mar 2004 23:50:12 +0100

Hash: SHA1

Hi Bob!

On 31 Mar 2004, at 18:11, Bob Friesenhahn wrote:
On Wed, 31 Mar 2004, Gary V. Vaughan wrote:
Okay to commit?

This addresses the memory management problems in libltdl brought
to light by the kaffe people.

The style of this change confuses me, and it doesn't seem to do
exactly the same thing:

   /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory.  */
   if (!argz_len)
-    LT_DLFREE (argz);
+    argz = (free (argz), (char *) 0);

Actually, they are exactly the same after cpp is done!

The change of lt_ functions to 'x' versions (e.g. xmalloc)
implies that it is intended that these functions be moved out of
ltdl.c and into another source module.

When I wrote it, I had hoped to migrate to gnulib xmalloc with my next
patch... after todays discussions that ain't gonna happen.

If so, the 'x' versions may
then conflict with other 'x' versions used by the dependent program.
It seems better to retain the lt_ prefix because then the origin of
the functions is more clear and there is no danger of conflict.

Gnu programmers are used to the xmalloc api, and it is reimplemented all
over the place, and lowers the barrier for contributing, so I'm inclined
to reuse the idiom if possible.  When it comes to splitting out xalloc
functions, we can leave them static and #include "xalloc.c" into ltdl.c.
Eventually I'd like there to be enough sanity in libltdl source that
someone with a reasonable familiarity with the GNU programming style and
idioms could get to grips with ltdl.c in a few hours... the first step
is eliminating as much macro noise, and not-invented-here-isms as I can.

- --
Gary V. Vaughan      ())_.  address@hidden,}
Research Scientist   ( '/
GNU Hacker           / )=
Technical Author   `(_~)_

Version: GnuPG v1.2.2 (Darwin)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]