Add a field borrow_offset to the type descriptor indicating

what amount a T* pointer must be adjusted to reach the contents
of the box. For `~T` types, this requires knowing the type `T`,
which is not known in the case of objects.
This commit is contained in:
Niko Matsakis 2013-08-11 13:29:14 -04:00
parent 3aefb9649d
commit 6fe59bf877
9 changed files with 94 additions and 16 deletions

View file

@ -58,6 +58,7 @@ struct type_desc {
glue_fn *drop_glue;
glue_fn *free_glue;
glue_fn *visit_glue;
size_t borrow_offset;
};
extern "C" type_desc *rust_clone_type_desc(type_desc*);

View file

@ -21,6 +21,7 @@ struct type_desc str_body_tydesc = {
NULL, // drop_glue
NULL, // free_glue
NULL, // visit_glue
0, // borrow_offset
};
//