forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeGenAllocators.cpp
More file actions
27 lines (25 loc) · 1.25 KB
/
CodeGenAllocators.cpp
File metadata and controls
27 lines (25 loc) · 1.25 KB
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#include "BackEnd.h"
CodeGenAllocators::CodeGenAllocators(AllocationPolicyManager * policyManager, Js::ScriptContext * scriptContext)
: pageAllocator(policyManager, Js::Configuration::Global.flags, PageAllocatorType_BGJIT,
(AutoSystemInfo::Data.IsLowMemoryProcess() ?
PageAllocator::DefaultLowMaxFreePageCount :
PageAllocator::DefaultMaxFreePageCount))
, allocator(L"NativeCode", &pageAllocator, Js::Throw::OutOfMemory)
, emitBufferManager(policyManager, &allocator, scriptContext, L"JIT code buffer", ALLOC_XDATA)
#if !_M_X64_OR_ARM64 && _CONTROL_FLOW_GUARD
, canCreatePreReservedSegment(false)
#endif
#ifdef PERF_COUNTERS
, staticNativeCodeData(0)
#endif
{
}
CodeGenAllocators::~CodeGenAllocators()
{
PERF_COUNTER_SUB(Code, StaticNativeCodeDataSize, staticNativeCodeData);
PERF_COUNTER_SUB(Code, TotalNativeCodeDataSize, staticNativeCodeData);
}