pg_dump, and strings

From: "Ansley, Michael" <Michael(dot)Ansley(at)intec(dot)co(dot)za>
To: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_dump, and strings
Date: 1999-10-30 22:09:38
Message-ID: 1BF7C7482189D211B03F00805F8527F748C1DE@S-NATH-EXCH2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-10-30 22:19:10 Re: [HACKERS] Function-manager redesign: second draft (long)
Previous Message frankpit 1999-10-30 22:05:53 Re: [HACKERS] Function-manager redesign: second draft (long)