Skip to content

Commit 10a5322

Browse files
Exporting reset_munmap_all_arenas to C and Python Bindings (#1210)
1 parent f7d4150 commit 10a5322

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

bindings/c/include/kllvm-c/kllvm-c.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ void kore_symbol_add_formal_argument(kore_symbol *, kore_sort const *);
159159

160160
void kllvm_init(void);
161161
void kllvm_free_all_memory(void);
162+
void kllvm_reset_munmap_all_arenas(void);
162163

163164
/* Sort-specific functions */
164165

bindings/c/lib.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ auto managed(kore_symbol *ptr) {
6969
extern "C" {
7070
void free_all_kore_mem();
7171
bool hook_BYTES_mutableBytesEnabled();
72+
void reset_munmap_all_arenas();
7273
}
7374

7475
extern "C" {
@@ -430,6 +431,10 @@ void kllvm_free_all_memory(void) {
430431
free_all_kore_mem();
431432
}
432433

434+
void kllvm_reset_munmap_all_arenas(void) {
435+
reset_munmap_all_arenas();
436+
}
437+
433438
bool kllvm_mutable_bytes_enabled(void) {
434439
return hook_BYTES_mutableBytesEnabled();
435440
}

bindings/python/runtime.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ PYBIND11_DECLARE_HOLDER_TYPE(T, raw_ptr<T>, true);
4242
extern "C" {
4343
void init_static_objects(void);
4444
void free_all_kore_mem(void);
45+
void reset_munmap_all_arenas(void);
4546
block *take_steps(int64_t, block *);
4647
void *construct_initial_configuration(kore_pattern const *initial);
4748
}
@@ -61,6 +62,7 @@ void bind_runtime(py::module_ &m) {
6162

6263
m.def("init_static_objects", init_static_objects);
6364
m.def("free_all_gc_memory", free_all_kore_mem);
65+
m.def("reset_munmap_all_arenas", reset_munmap_all_arenas);
6466

6567
// This class can't be used directly from Python; the mutability semantics
6668
// that we get from the Pybind wrappers make it really easy to break things.

0 commit comments

Comments
 (0)