sandbox
Loading...
Searching...
No Matches
garbage_collection.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_SCRIPTING_MANAGED_GARBAGE_COLLECTION_HPP_
3#define LIBSBX_SCRIPTING_MANAGED_GARBAGE_COLLECTION_HPP_
4
5#include <cstdint>
6
7namespace sbx::scripting::managed {
8
10
11 enum class mode : std::uint8_t {
12 standart, // Default is the same as using Forced directly
13 forced, // Forces the garbage collection to occur immediately
14 optimized, // Allows the garbage collector to determine whether it should reclaim objects right now
15 aggressive // Requests that the garbage collector decommit as much memory as possible
16 }; // enum class mode
17
18 static auto collect() -> void;
19
20 static auto collect(std::int32_t generation, mode collection_mode = mode::standart, bool is_blocking = true, bool compacting = false) -> void;
21
22 static auto wait_for_pending_finalizers() -> void;
23
24}; // struct garbage_collection
25
26} // namespace sbx::scripting::managed
27
28#endif // LIBSBX_SCRIPTING_MANAGED_GARBAGE_COLLECTION_HPP_
Definition: garbage_collection.hpp:9