Re: [HACKERS] What is nameout() for? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] What is nameout() for?
Date
Msg-id 199911072048.PAA14933@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] What is nameout() for?  (Mike Mascari <mascarim@yahoo.com>)
List pgsql-hackers
> Actually, I have 'C' question regarding the above code. Where does the
> "-" live in RAM? Does the compiler generated a data hunk such that this
> string will be apart of the final executable and each invocation of this
> routine would result in a pointer to that 'global' location being
> returned? 
> Or does it allocate the memory for, and initialize, the "-" on the stack? 
> If so, isn't returning a "-" a dangerous act?
> 
> In fact, isn't returning a "-" dangerous either way without the 
> protoype being:

One copy, usually in the text segment because it is ready-only.


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Mike Mascari
Date:
Subject: Re: [HACKERS] What is nameout() for?
Next
From: Bruce Momjian
Date:
Subject: New NameStr() macro, RelationGetRelationName fixes