CodeGenAllocators.h 1.1 KB

123456789101112131415161718192021222324252627282930
  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. #pragma once
  6. #if PDATA_ENABLED
  7. #define ALLOC_XDATA (true)
  8. #else
  9. #define ALLOC_XDATA (false)
  10. #endif
  11. struct CodeGenAllocators
  12. {
  13. // emitBufferManager depends on allocator which in turn depends on pageAllocator, make sure the sequence is right
  14. PageAllocator pageAllocator;
  15. NoRecoverMemoryArenaAllocator allocator;
  16. EmitBufferManager<CriticalSection> emitBufferManager;
  17. #if !_M_X64_OR_ARM64 && _CONTROL_FLOW_GUARD
  18. bool canCreatePreReservedSegment;
  19. #endif
  20. #ifdef PERF_COUNTERS
  21. size_t staticNativeCodeData;
  22. #endif
  23. CodeGenAllocators(AllocationPolicyManager * policyManager, Js::ScriptContext * scriptContext);
  24. PageAllocator *GetPageAllocator() { return &pageAllocator; };
  25. ~CodeGenAllocators();
  26. };