@@ -77,25 +77,6 @@ upcall_malloc(rust_task *task, size_t nbytes, type_desc *td) {
77
77
return (uintptr_t ) p;
78
78
}
79
79
80
- extern " C" CDECL rust_box *
81
- upcall_malloc_box (rust_task *task, size_t nbytes, type_desc *td) {
82
- LOG_UPCALL_ENTRY (task);
83
-
84
- gc::maybe_gc (task);
85
-
86
- rust_box *box = reinterpret_cast <rust_box *>
87
- (task->malloc (nbytes + sizeof (rust_box), " tdesc" , td));
88
- box->ref_count = 1 ;
89
- box->tydesc = td;
90
-
91
- box->gc_prev = NULL ;
92
- if ((box->gc_next = task->gc_alloc_chain ) != NULL )
93
- box->gc_next ->gc_prev = box;
94
- task->gc_alloc_chain = box;
95
-
96
- return box;
97
- }
98
-
99
80
/* *
100
81
* Called whenever an object's ref count drops to zero.
101
82
*/
@@ -110,24 +91,6 @@ upcall_free(rust_task *task, void* ptr, uintptr_t is_gc) {
110
91
task->free (ptr, (bool ) is_gc);
111
92
}
112
93
113
- extern " C" CDECL void
114
- upcall_free_box (rust_task *task, rust_box *box) {
115
- LOG_UPCALL_ENTRY (task);
116
-
117
- assert (!box->ref_count && " Box reference count is nonzero on free!" );
118
-
119
- if (box->gc_prev )
120
- box->gc_prev ->gc_next = box->gc_next ;
121
- else
122
- task->gc_alloc_chain = box->gc_next ;
123
- if (box->gc_next )
124
- box->gc_next ->gc_prev = box->gc_prev ;
125
-
126
- box->tydesc ->drop_glue (NULL , task, (void *)box->tydesc ,
127
- box->tydesc ->first_param , box->data );
128
- task->free (box, false );
129
- }
130
-
131
94
extern " C" CDECL uintptr_t
132
95
upcall_shared_malloc (rust_task *task, size_t nbytes, type_desc *td) {
133
96
LOG_UPCALL_ENTRY (task);
0 commit comments