This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: malloc patch for 2.2.4


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]