// In order to allow a complete switch between dispatch tables without // the need for copying each function by function in the structure, // use a single atomic pointer to switch. // The current_dispatch_table pointer can only ever be set to a complete // table. Any dispatch table that is pointed to by current_dispatch_table // cannot be modified after that. If the pointer changes in the future, // the old pointer must always stay valid. // The malloc_dispatch_table is modified by malloc debug, malloc hooks, // and heaprofd. Only one of these modes can be active at any given time.
_Atomic(const MallocDispatch*) current_dispatch_table; // This pointer is only used by the allocation limit code when both a // limit is enabled and some other hook is enabled at the same time.
_Atomic(const MallocDispatch*) default_dispatch_table;
MallocDispatch malloc_dispatch_table;
};
__LIBC_HIDDEN__ extern WriteProtected<libc_globals> __libc_globals; // These cannot be in __libc_globals, because we cannot access the // WriteProtected in a thread-safe way. // See b/328256432. // // __libc_memtag_stack says whether stack MTE is enabled on the process, i.e. // whether the stack pages are mapped with PROT_MTE. This is always false if // MTE is disabled for the process (i.e. libc_globals.memtag is false).
__LIBC_HIDDEN__ extern _Atomic(bool) __libc_memtag_stack; // __libc_memtag_stack_abi says whether the process contains any code that was // compiled with memtag-stack. This is true even if the process does not have // MTE enabled (e.g. because it was overridden using MEMTAG_OPTIONS, or because // MTE is disabled for the device). // Code compiled with memtag-stack needs a stack history buffer in // TLS_SLOT_STACK_MTE, because the codegen will emit an unconditional // (to keep the code branchless) write to it. // Protected by g_heap_creation_lock.
__LIBC_HIDDEN__ externbool __libc_memtag_stack_abi;
// Globals shared between the dynamic linker and libc.so. struct libc_shared_globals { // Construct the shared globals using a constexpr constructor to ensure that // the object doesn't need dynamic initialization. The object is accessed // before the dynamic linker has relocated itself.
constexpr libc_shared_globals() {}
FdTable fd_table;
// When the linker is invoked on a binary (e.g. `linker64 /system/bin/date`), // record the number of arguments passed to the linker itself rather than to // the program it's loading. Typically 0, sometimes 1. int initial_linker_arg_count = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.