emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: USE_LSB_TAG not supported on this platform


From: Paul Eggert
Subject: Re: USE_LSB_TAG not supported on this platform
Date: Tue, 9 Feb 2016 09:37:15 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02/09/2016 08:59 AM, Eli Zaretskii wrote:
Thanks.  Out of curiosity: which hosts can behave like that?

16-bit PDP-11s running 7th Edition Unix. malloc returned only a multiple of 2 there. :-)

I think there were 32-bit platforms where malloc returned only a multiple of 4, but can't find any offhand now. For what it's worth, glibc documents a minimum of 8, for all glibc platforms.

Also, why are we sure that the loops will end at some point on those
hosts?  Shouldn't we perhaps set a limit to the loop iterations, to be
sure we don't infloop there?

We're not absolutely sure. Certainly the C standard doesn't guarantee it; malloc can return a pointer that is always odd, on weird platforms where alignof always returns 1. I view this as almost purely theoretical though, due to the practical performance benefit of alignment to at least sizeof(double). It's conceivable (though very unlikely) that Emacs will infloop on some truly oddball platform that does not care about performance; but if that happens it'll be OK, as the infloop would almost surely happen during a build and the builder would then send us a bug report and we can deal with it then. I think adding a counter would complicate the code (and possibly introduce bugs, in code that's never really exercised) for not enough benefit.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]