Re: [HACKERS] pg_dump, and strings

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Ansley, Michael" <Michael(dot)Ansley(at)intec(dot)co(dot)za>
Cc: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] pg_dump, and strings
Date: 1999-10-30 23:45:21
Message-ID: Pine.LNX.4.10.9910310141310.462-100000@peter-e.yi.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Oct 31, Ansley, Michael mentioned:

> Hi, all
>
> In pg_dump there is a file called common.c. This file has some string
> handling routines in it that return a pointer to a fixed-length, static
> string (char *). I need to remove the fixed-length bit (besides the fact
> fact that this is horrendously un-threadsafe). So, what is the best
> mechanism to use on replacement? There seem to be two fairly standard
> methods to use, a) make the calling function allocate the memory it
> requires, and pass that in to the called function, or b) the called function
> allocates memory using a documented call (say, malloc), and hands
> responsibility for freeing the memory to the calling function. Given the
> non-fixed-length constraint, the second option would appear better, but does
> any body out there have any other ideas?
>
> MikeA

Of course malloc is not very thread-safe either.

But as far is I'm concerned, the difference between a) and b) is cosmetic.

--
Peter Eisentraut Sernanders vaeg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 1999-10-31 00:19:50 Re: [HACKERS] missing mugshots
Previous Message Jan Wieck 1999-10-30 23:35:58 Re: [HACKERS] missing mugshots