Re: [HACKERS] Share state ( allocated memory ) across two C functions... - Mailing list pgsql-general

From Joe Conway
Subject Re: [HACKERS] Share state ( allocated memory ) across two C functions...
Date
Msg-id 3F00C64C.9020909@joeconway.com
Whole thread Raw
In response to Share state ( allocated memory ) across two C functions...  ("Maksim Likharev" <mlikharev@aurigin.com>)
List pgsql-general
Maksim Likharev wrote:
> Of cause I can return a handle from first function, pointer and accept
> that pointer in second function, but in this case I have to check
> that pointer on validity and so on...
>
> Is there any good practice ( some way to do so ) for that?
>

Best way I've come up with to do this is by using a hash table based on
a name lookup. See the way it's done in dblink now (as of a week or so
ago) for named persistent connections.

HTH,

Joe


pgsql-general by date:

Previous
From: "Maksim Likharev"
Date:
Subject: Share state ( allocated memory ) across two C functions...
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Pg_Dumpall error?