remove ref_array_idx from the ref array and add its spot to the free list (at refs[0])
| 527 | |
| 528 | // remove ref_array_idx from the ref array and add its spot to the free list (at refs[0]) |
| 529 | static void free_ref(duk_context* ctx, duk_uarridx_t ref_array_idx) |
| 530 | { |
| 531 | push_ref_array(ctx); |
| 532 | |
| 533 | // add this spot to the free list |
| 534 | // refs[old_obj_idx] = refs[0] (implicitly gives up our reference) |
| 535 | duk_get_prop_index(ctx, -1, 0); |
| 536 | duk_put_prop_index(ctx, -2, ref_array_idx); |
| 537 | |
| 538 | // refs[0] = old_obj_idx |
| 539 | duk_push_uint(ctx, ref_array_idx); |
| 540 | duk_put_prop_index(ctx, -2, 0); |
| 541 | |
| 542 | duk_pop(ctx); // pop ref array |
| 543 | } |
| 544 | |
| 545 | // this is for reference counting - used to release our reference based on the state |
| 546 | // of mRefCount. If mRefCount is NULL, we never got copy constructed, so we have ownership |
nothing calls this directly
no outgoing calls
no test coverage detected