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:
parent
3aefb9649d
commit
6fe59bf877
9 changed files with 94 additions and 16 deletions
|
|
@ -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*);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ struct type_desc str_body_tydesc = {
|
|||
NULL, // drop_glue
|
||||
NULL, // free_glue
|
||||
NULL, // visit_glue
|
||||
0, // borrow_offset
|
||||
};
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue