aboutsummaryrefslogtreecommitdiff
path: root/lib/scudo/scudo_tls.h
blob: 0d7d1bffd0b61f6f5de381f2dc49b5fc059f7f95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//===-- scudo_tls.h ---------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// Scudo thread local structure definition.
/// Implementation will differ based on the thread local storage primitives
/// offered by the underlying platform.
///
//===----------------------------------------------------------------------===//

#ifndef SCUDO_TLS_H_
#define SCUDO_TLS_H_

#include "scudo_allocator.h"
#include "scudo_utils.h"

namespace __scudo {

struct ALIGNED(64) ScudoThreadContext {
 public:
  AllocatorCache Cache;
  Xorshift128Plus Prng;
  uptr QuarantineCachePlaceHolder[4];
  void init();
  void commitBack();
};

void initThread();

// Fastpath functions are defined in the following platform specific headers.
#include "scudo_tls_linux.h"

}  // namespace __scudo

#endif  // SCUDO_TLS_H_