forked from microsoft/snmalloc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpal_consts.h
56 lines (54 loc) · 1.74 KB
/
pal_consts.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
namespace snmalloc
{
/**
* Flags in a bitfield of optional features that a PAL may support. These
* should be set in the PAL's `pal_features` static constexpr field.
*/
enum PalFeatures : uint64_t
{
/**
* This PAL supports low memory notifications. It must implement a
* `low_memory_epoch` method that returns a `uint64_t` of the number of
* times that a low-memory notification has been raised and an
* `expensive_low_memory_check()` method that returns a `bool` indicating
* whether low memory conditions are still in effect.
*/
LowMemoryNotification = (1 << 0),
/**
* This PAL natively supports allocation with a guaranteed alignment. If
* this is not supported, then we will over-allocate and round the
* allocation.
*
* A PAL that does supports this must expose a `request()` method that takes
* a size and alignment. A PAL that does *not* support it must expose a
* `request()` method that takes only a size.
*/
AlignedAllocation = (1 << 1),
/**
* This PAL natively supports lazy commit of pages. This means have large
* allocations and not touching them does not increase memory usage. This is
* exposed in the Pal.
*/
LazyCommit = (1 << 2),
};
/**
* Flag indicating whether requested memory should be zeroed.
*/
enum ZeroMem
{
/**
* Memory should not be zeroed, contents are undefined.
*/
NoZero,
/**
* Memory must be zeroed. This can be lazily allocated via a copy-on-write
* mechanism as long as any load from the memory returns zero.
*/
YesZero
};
/**
* Default Tag ID for the Apple class
*/
static const int PALAnonDefaultID = 241;
} // namespace snmalloc