LLVM 20.0.0git
SimpleExecutorMemoryManager.h
Go to the documentation of this file.
1//===---------------- SimpleExecutorMemoryManager.h -------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// A simple allocator class suitable for basic remote-JIT use.
10//
11// FIXME: The functionality in this file should be moved to the ORC runtime.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_SIMPLEEXECUTORMEMORYMANAGER_H
16#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_SIMPLEEXECUTORMEMORYMANAGER_H
17
18#include "llvm/ADT/DenseMap.h"
23#include "llvm/Support/Error.h"
24
25#include <mutex>
26
27namespace llvm {
28namespace orc {
29namespace rt_bootstrap {
30
31/// Simple page-based allocator.
33public:
35
38 Error deallocate(const std::vector<ExecutorAddr> &Bases);
39
40 Error shutdown() override;
42
43private:
44 struct Allocation {
45 size_t Size = 0;
46 std::vector<shared::WrapperFunctionCall> DeallocationActions;
47 };
48
50
51 Error deallocateImpl(void *Base, Allocation &A);
52
54 reserveWrapper(const char *ArgData, size_t ArgSize);
55
57 finalizeWrapper(const char *ArgData, size_t ArgSize);
58
60 deallocateWrapper(const char *ArgData, size_t ArgSize);
61
62 std::mutex M;
63 AllocationsMap Allocations;
64};
65
66} // end namespace rt_bootstrap
67} // end namespace orc
68} // end namespace llvm
69
70#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_SIMPLEEXECUTORMEMORYMANAGER_H
arc branch finalize
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file defines the DenseMap class.
uint64_t Size
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
Tagged union holding either a T or a Error.
Definition: Error.h:481
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:128
Error deallocate(const std::vector< ExecutorAddr > &Bases)
void addBootstrapSymbols(StringMap< ExecutorAddr > &M) override
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18