android crazy linker: better Globals implementation.
A small cleanup and/or improvement to the way global data is managed in the crazy linker library: - Replace ScopedGlobalLock with ScopedLockedGlobals which allows reducing the number of Globals::Get() call performed at runtime. - Provide property accessors to the globals that don't call Globals::Get() on each call, e.g. the static Globals::GetLibraries() is replaced by the non-static Globals::libraries() call. - In crazy_linker_api.cpp, Fix a minor bug where the ScopedDelayedCallbackPoster is constructed before the global lock is acquired (i.e. a thread-race). Note that there are still other thread-related issues with deferred tasks / callback handling but these will be addressed in a future CL. - Don't use heap allocation for the Globals instance storage. This is mostly because there were suspicion of invalid pointer addresses being passed through callbacks, causing runtime crashes (see http://crbug.com/796938 for more details). A fixed address in the .bss section would be easier to spot in minidump CPU register dumps. BUG=801548 R=agrieve@chromium.org,pasko@chromium.org,rmcilroy@chromium.org Change-Id: I68cba5360c5b5a3aaa7847172a6e73a87a64d44b Reviewed-on: https://chromium-review.googlesource.com/893259Reviewed-by:agrieve <agrieve@chromium.org> Reviewed-by:
Egor Pasko <pasko@chromium.org> Commit-Queue: David Turner <digit@chromium.org> Cr-Commit-Position: refs/heads/master@{#532889}
Showing
Please register or sign in to comment