Skip to content

Commit f8323ac

Browse files
author
Elliott Slaughter
committed
rt: Add interface to box annihilator.
1 parent dbf6abf commit f8323ac

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/rt/rust_box_annihilator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "rust_globals.h"
33
#include "rust_task.h"
44
#include "rust_shape.h"
5+
#include "rust_box_annihilator.h"
56

67
class annihilator : public shape::data<annihilator,shape::ptr> {
78
friend class shape::data<annihilator,shape::ptr>;

src/rt/rust_box_annihilator.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef RUST_BOX_ANNIHILATOR_H
2+
#define RUST_BOX_ANNIHILATOR_H
3+
4+
#include "rust_task.h"
5+
6+
void
7+
annihilate_box(rust_task *task, rust_opaque_box *box);
8+
9+
void
10+
annihilate_boxes(rust_task *task);
11+
12+
#endif

src/rt/rust_builtin.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "sync/timer.h"
88
#include "rust_abi.h"
99
#include "rust_port.h"
10+
#include "rust_box_annihilator.h"
1011

1112
#include <time.h>
1213

@@ -740,6 +741,12 @@ rust_set_exit_status(intptr_t code) {
740741
task->kernel->set_exit_status((int)code);
741742
}
742743

744+
extern "C" CDECL void
745+
rust_annihilate_box(rust_opaque_box *ptr) {
746+
rust_task *task = rust_get_current_task();
747+
annihilate_box(task, ptr);
748+
}
749+
743750
extern void log_console_on();
744751

745752
extern "C" CDECL void

0 commit comments

Comments
 (0)