CodeGenAllocators.cpp 1.0 KB

123456789101112131415161718192021222324252627
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #include "Backend.h"
  6. CodeGenAllocators::CodeGenAllocators(AllocationPolicyManager * policyManager, Js::ScriptContext * scriptContext)
  7. : pageAllocator(policyManager, Js::Configuration::Global.flags, PageAllocatorType_BGJIT, 0)
  8. , allocator(L"NativeCode", &pageAllocator, Js::Throw::OutOfMemory)
  9. , emitBufferManager(&allocator, scriptContext->GetThreadContext()->GetCodePageAllocators(), scriptContext, L"JIT code buffer")
  10. #if !_M_X64_OR_ARM64 && _CONTROL_FLOW_GUARD
  11. , canCreatePreReservedSegment(false)
  12. #endif
  13. {
  14. }
  15. CodeGenAllocators::~CodeGenAllocators()
  16. {
  17. }
  18. #if DBG
  19. void
  20. CodeGenAllocators::ClearConcurrentThreadId()
  21. {
  22. this->pageAllocator.ClearConcurrentThreadId();
  23. }
  24. #endif