malloc patch for 2.2.4
Bruno Haible
haible@ilog.fr
Wed Aug 22 11:40:00 GMT 2001
> Second, _if_ the compiler would actually reload from the global
> variable in this case (strictly speaking it has the right to do so
> under ANSI C), I'd consider it _unsuitable_ for threaded programs.
> There would definitely need to be a switch to turn this off.
The switch exists and is called 'volatile'. If the three variables
__malloc_hook, __realloc_hook, __free_hook are declared volatile, the
compiler must not turn the local variable reference into a global
variable reference.
Bruno
More information about the Libc-alpha
mailing list