chromium/base/allocator/dispatcher/tls.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/allocator/dispatcher/tls.h"

#include <string_view>

#if USE_LOCAL_TLS_EMULATION()

#include "base/check.h"
#include "base/dcheck_is_on.h"
#include "base/debug/crash_logging.h"
#include "base/immediate_crash.h"
#include "build/build_config.h"

#include <sys/mman.h>

#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
#include <sys/prctl.h>
#endif

namespace base::allocator::dispatcher::internal {
namespace {
base::debug::CrashKeySize GetCrashKeySize(const std::string& crash_key_name) {}

#if DCHECK_IS_ON()
void Swap(std::atomic_bool& lh_op, std::atomic_bool& rh_op) {}
#endif
}  // namespace

void* MMapAllocator::AllocateMemory(size_t size_in_bytes) {}

bool MMapAllocator::FreeMemoryForTesting(void* pointer_to_allocated,
                                         size_t size_in_bytes) {}

PThreadTLSSystem::PThreadTLSSystem() = default;

PThreadTLSSystem::PThreadTLSSystem(PThreadTLSSystem&& other) {}

PThreadTLSSystem& PThreadTLSSystem::operator=(PThreadTLSSystem&& other) {}

bool PThreadTLSSystem::Setup(
    OnThreadTerminationFunction thread_termination_function,
    const std::string_view instance_id) {}

bool PThreadTLSSystem::TearDownForTesting() {}

void* PThreadTLSSystem::GetThreadSpecificData() {}

bool PThreadTLSSystem::SetThreadSpecificData(void* data) {}

}  // namespace base::allocator::dispatcher::internal

#endif  // USE_LOCAL_TLS_EMULATION()