LLVM: include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_EXECUTIONENGINE_ORC_MAPPERJITLINKMEMORYMANAGER_H

14#define LLVM_EXECUTIONENGINE_ORC_MAPPERJITLINKMEMORYMANAGER_H

15

20

21namespace llvm {

22namespace orc {

23

26public:

28 std::unique_ptr Mapper);

29

30 template <class MemoryMapperType, class... Args>

33 auto Mapper = MemoryMapperType::Create(std::forward(A)...);

34 if (!Mapper)

35 return Mapper.takeError();

36

37 return std::make_unique(ReservationGranularity,

38 std::move(*Mapper));

39 }

40

42 OnAllocatedFunction OnAllocated) override;

43

44 using JITLinkMemoryManager::allocate;

45

46 void deallocate(std::vector Allocs,

47 OnDeallocatedFunction OnDeallocated) override;

48

49 using JITLinkMemoryManager::deallocate;

50

51private:

52 class InFlightAlloc;

53

55

56

57 size_t ReservationUnits;

58

59

61 AvailableMemoryMap::Allocator AMAllocator;

63

64

66

67 std::unique_ptr Mapper;

68};

69

70}

71}

72

73#endif

static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")

This file implements a coalescing interval map for small objects.

Tagged union holding either a T or a Error.

Manages allocations of JIT memory.

static Expected< std::unique_ptr< MapperJITLinkMemoryManager > > CreateWithMapper(size_t ReservationGranularity, Args &&...A)

Definition MapperJITLinkMemoryManager.h:32

MapperJITLinkMemoryManager(size_t ReservationGranularity, std::unique_ptr< MemoryMapper > Mapper)

SmartMutex< false > Mutex

Mutex - A standard, always enforced mutex.

This is an optimization pass for GlobalISel generic memory operations.