envcache: huh?

Christopher Faylor me@cgf.cx
Tue Aug 2 19:31:00 GMT 2005

[cgf from a library wifi]
On Mon, Aug 01, 2005 at 02:33:10PM +0200, Corinna Vinschen wrote:
>On Jul 28 14:45, Dave Korn wrote:
>>   And we're storing through the 'x' member, which is a DWORD pointer, yes?
>>   And the thing we're storing into is a bool, yes?
>>   Which is one byte in size, yes?
>> ------------------------<snip>------------------------
>> 	.data
>> _envcache:
>> 	.byte	1
>> 	.text
>> ------------------------<snip>------------------------
>>   Oops?
>It is fishy, I agree.  Probably we had no problem so far since there's
>no overlapping within 4 bytes in the DLL, AFAICS, but this could change
>with another ld version.  I guess your idea is worthwhile to implement.

I think the default alignment for data is at least 4 bytes so it's not
likely to cause a problem.

OTOH, envcache should probably be nuked entirely.  I added it as a fallback
in case something went wrong with caching but it doesn't seem to be needed

<obligatory-statement-of-understanding>I do understand that there are other
variables being used similarly.  The above statement about envcacehe was only
about envcache and does not have any bearing on any other aspect of the
proposed change, although, I'd probably opt for the least intrusive method
of just changing bools to DWORDs.</obligatory-statement-of-understanding>


More information about the Cygwin-developers mailing list