Some cleanup in the runtime.
This commit is contained in:
parent
8967a66724
commit
b4484d51c1
4 changed files with 9 additions and 8 deletions
|
@ -271,9 +271,8 @@ static void
|
||||||
debug_tydesc_helper(type_desc *t)
|
debug_tydesc_helper(type_desc *t)
|
||||||
{
|
{
|
||||||
rust_task *task = rust_get_current_task();
|
rust_task *task = rust_get_current_task();
|
||||||
LOG(task, stdlib, " size %" PRIdPTR ", align %" PRIdPTR
|
LOG(task, stdlib, " size %" PRIdPTR ", align %" PRIdPTR,
|
||||||
", first_param 0x%" PRIxPTR,
|
t->size, t->align);
|
||||||
t->size, t->align, t->first_param);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CDECL void
|
extern "C" CDECL void
|
||||||
|
|
|
@ -47,7 +47,6 @@ const uint8_t SHAPE_VEC = 11u;
|
||||||
const uint8_t SHAPE_TAG = 12u;
|
const uint8_t SHAPE_TAG = 12u;
|
||||||
const uint8_t SHAPE_STRUCT = 17u;
|
const uint8_t SHAPE_STRUCT = 17u;
|
||||||
const uint8_t SHAPE_BOX_FN = 18u;
|
const uint8_t SHAPE_BOX_FN = 18u;
|
||||||
const uint8_t SHAPE_OBJ = 19u;
|
|
||||||
const uint8_t SHAPE_RES = 20u;
|
const uint8_t SHAPE_RES = 20u;
|
||||||
const uint8_t SHAPE_UNIQ = 22u;
|
const uint8_t SHAPE_UNIQ = 22u;
|
||||||
const uint8_t SHAPE_UNIQ_FN = 25u;
|
const uint8_t SHAPE_UNIQ_FN = 25u;
|
||||||
|
|
|
@ -171,7 +171,7 @@ void task_start_wrapper(spawn_args *a)
|
||||||
if(env) {
|
if(env) {
|
||||||
// free the environment (which should be a unique closure).
|
// free the environment (which should be a unique closure).
|
||||||
const type_desc *td = env->td;
|
const type_desc *td = env->td;
|
||||||
td->drop_glue(NULL, NULL, td->first_param, box_body(env));
|
td->drop_glue(NULL, NULL, NULL, box_body(env));
|
||||||
upcall_exchange_free(env);
|
upcall_exchange_free(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,11 @@
|
||||||
#ifndef RUST_TYPE_H
|
#ifndef RUST_TYPE_H
|
||||||
#define RUST_TYPE_H
|
#define RUST_TYPE_H
|
||||||
|
|
||||||
|
#include "rust_globals.h"
|
||||||
#include "rust_refcount.h"
|
#include "rust_refcount.h"
|
||||||
|
|
||||||
|
struct rust_opaque_box;
|
||||||
|
|
||||||
// The type of functions that we spawn, which fall into two categories:
|
// The type of functions that we spawn, which fall into two categories:
|
||||||
// - the main function: has a NULL environment, but uses the void* arg
|
// - the main function: has a NULL environment, but uses the void* arg
|
||||||
// - unique closures of type fn~(): have a non-NULL environment, but
|
// - unique closures of type fn~(): have a non-NULL environment, but
|
||||||
|
@ -45,21 +48,21 @@ static inline void *box_body(rust_opaque_box *box) {
|
||||||
// N.B. If you want to add a field to tydesc, please use one of the
|
// N.B. If you want to add a field to tydesc, please use one of the
|
||||||
// unused fields!
|
// unused fields!
|
||||||
struct type_desc {
|
struct type_desc {
|
||||||
const type_desc **first_param;
|
uintptr_t UNUSED_1;
|
||||||
size_t size;
|
size_t size;
|
||||||
size_t align;
|
size_t align;
|
||||||
glue_fn *take_glue;
|
glue_fn *take_glue;
|
||||||
glue_fn *drop_glue;
|
glue_fn *drop_glue;
|
||||||
glue_fn *free_glue;
|
glue_fn *free_glue;
|
||||||
glue_fn *visit_glue;
|
glue_fn *visit_glue;
|
||||||
uintptr_t UNUSED_1;
|
|
||||||
uintptr_t UNUSED_2;
|
uintptr_t UNUSED_2;
|
||||||
uintptr_t UNUSED_3;
|
uintptr_t UNUSED_3;
|
||||||
uintptr_t UNUSED_4;
|
uintptr_t UNUSED_4;
|
||||||
|
uintptr_t UNUSED_5;
|
||||||
const uint8_t *shape;
|
const uint8_t *shape;
|
||||||
const rust_shape_tables *shape_tables;
|
const rust_shape_tables *shape_tables;
|
||||||
uintptr_t UNUSED_5;
|
|
||||||
uintptr_t UNUSED_6;
|
uintptr_t UNUSED_6;
|
||||||
|
uintptr_t UNUSED_7;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" type_desc *rust_clone_type_desc(type_desc*);
|
extern "C" type_desc *rust_clone_type_desc(type_desc*);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue