@@ -249,24 +249,16 @@ debug_opaque(type_desc *t, uint8_t *front) {
249
249
}
250
250
}
251
251
252
- // FIXME (#2667) this no longer reflects the actual structure of boxes!
253
- struct rust_box {
254
- RUST_REFCOUNTED (rust_box)
255
-
256
- // FIXME (#2667) `data` could be aligned differently from the actual
257
- // box body data
258
- uint8_t data[];
259
- };
260
-
261
252
extern " C" CDECL void
262
- debug_box (type_desc *t, rust_box *box) {
253
+ debug_box (type_desc *t, rust_opaque_box *box) {
263
254
rust_task *task = rust_get_current_task ();
264
255
LOG (task, stdlib, " debug_box(0x%" PRIxPTR " )" , box);
265
256
debug_tydesc_helper (t);
266
257
LOG (task, stdlib, " refcount %" PRIdPTR,
267
258
box->ref_count - 1 ); // -1 because we ref'ed for this call
259
+ uint8_t *data = (uint8_t *)box_body (box);
268
260
for (uintptr_t i = 0 ; i < t->size ; ++i) {
269
- LOG (task, stdlib, " byte %" PRIdPTR " : 0x%" PRIx8, i, box-> data [i]);
261
+ LOG (task, stdlib, " byte %" PRIdPTR " : 0x%" PRIx8, i, data[i]);
270
262
}
271
263
}
272
264
@@ -288,20 +280,15 @@ debug_tag(type_desc *t, rust_tag *tag) {
288
280
tag->variant [i]);
289
281
}
290
282
291
- struct rust_fn {
292
- uintptr_t *thunk;
293
- rust_box *closure;
294
- };
295
-
296
283
extern " C" CDECL void
297
- debug_fn (type_desc *t, rust_fn *fn) {
284
+ debug_fn (type_desc *t, fn_env_pair *fn) {
298
285
rust_task *task = rust_get_current_task ();
299
286
LOG (task, stdlib, " debug_fn" );
300
287
debug_tydesc_helper (t);
301
- LOG (task, stdlib, " thunk at 0x%" PRIxPTR, fn->thunk );
302
- LOG (task, stdlib, " closure at 0x%" PRIxPTR, fn->closure );
303
- if (fn->closure ) {
304
- LOG (task, stdlib, " refcount %" PRIdPTR, fn->closure ->ref_count );
288
+ LOG (task, stdlib, " fn at 0x%" PRIxPTR, fn->f );
289
+ LOG (task, stdlib, " env at 0x%" PRIxPTR, fn->env );
290
+ if (fn->env ) {
291
+ LOG (task, stdlib, " refcount %" PRIdPTR, fn->env ->ref_count );
305
292
}
306
293
}
307
294
@@ -389,11 +376,6 @@ extern "C" CDECL FILE* rust_get_stdin() {return stdin;}
389
376
extern " C" CDECL FILE* rust_get_stdout () {return stdout;}
390
377
extern " C" CDECL FILE* rust_get_stderr () {return stderr;}
391
378
392
- extern " C" CDECL int
393
- rust_ptr_eq (type_desc *t, rust_box *a, rust_box *b) {
394
- return a == b;
395
- }
396
-
397
379
#if defined(__WIN32__)
398
380
extern " C" CDECL void
399
381
get_time (int64_t *sec, int32_t *nsec) {
0 commit comments