#include "memprof_thread.h"
#include "memprof_allocator.h"
#include "memprof_interceptors.h"
#include "memprof_mapping.h"
#include "memprof_stack.h"
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_placement_new.h"
#include "sanitizer_common/sanitizer_stackdepot.h"
#include "sanitizer_common/sanitizer_tls_get_addr.h"
namespace __memprof {
void MemprofThreadContext::OnCreated(void *arg) { … }
void MemprofThreadContext::OnFinished() { … }
alignas(16) static char thread_registry_placeholder[sizeof(ThreadRegistry)];
static ThreadRegistry *memprof_thread_registry;
static Mutex mu_for_thread_context;
static LowLevelAllocator allocator_for_thread_context;
static ThreadContextBase *GetMemprofThreadContext(u32 tid) { … }
ThreadRegistry &memprofThreadRegistry() { … }
MemprofThreadContext *GetThreadContextByTidLocked(u32 tid) { … }
MemprofThread *MemprofThread::Create(thread_callback_t start_routine, void *arg,
u32 parent_tid, StackTrace *stack,
bool detached) { … }
void MemprofThread::TSDDtor(void *tsd) { … }
void MemprofThread::Destroy() { … }
inline MemprofThread::StackBounds MemprofThread::GetStackBounds() const { … }
uptr MemprofThread::stack_top() { … }
uptr MemprofThread::stack_bottom() { … }
uptr MemprofThread::stack_size() { … }
void MemprofThread::Init(const InitOptions *options) { … }
thread_return_t
MemprofThread::ThreadStart(tid_t os_id,
atomic_uintptr_t *signal_thread_is_registered) { … }
MemprofThread *CreateMainThread() { … }
void MemprofThread::SetThreadStackAndTls(const InitOptions *options) { … }
bool MemprofThread::AddrIsInStack(uptr addr) { … }
MemprofThread *GetCurrentThread() { … }
void SetCurrentThread(MemprofThread *t) { … }
u32 GetCurrentTidOrInvalid() { … }
void EnsureMainThreadIDIsCorrect() { … }
}