-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathCodeGenAllocators.h
31 lines (27 loc) · 1.37 KB
/
CodeGenAllocators.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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
template<typename TAlloc, typename TPreReservedAlloc>
class CodeGenAllocators
{
// emitBufferManager depends on allocator which in turn depends on pageAllocator, make sure the sequence is right
private:
PageAllocator pageAllocator;
NoRecoverMemoryArenaAllocator allocator;
public:
EmitBufferManager<TAlloc, TPreReservedAlloc, CriticalSection> emitBufferManager;
#if !TARGET_64 && _CONTROL_FLOW_GUARD
bool canCreatePreReservedSegment;
#endif
CodeGenAllocators(AllocationPolicyManager * policyManager, Js::ScriptContext * scriptContext, ThreadContextInfo * threadContext, CustomHeap::CodePageAllocators<TAlloc, TPreReservedAlloc> * codePageAllocators, HANDLE processHandle);
~CodeGenAllocators();
#if DBG
void ClearConcurrentThreadId();
#endif
};
typedef CodeGenAllocators<VirtualAllocWrapper, PreReservedVirtualAllocWrapper> InProcCodeGenAllocators;
#if ENABLE_OOP_NATIVE_CODEGEN
typedef CodeGenAllocators<SectionAllocWrapper, PreReservedSectionAllocWrapper> OOPCodeGenAllocators;
#endif