Skip to content

Commit 729e25d

Browse files
committed
Removing unused refcount variable
The rebranch branch is failing to build due to an unused refcount variable in runtime.c. The variable is only used by an os_assert and nowhere else. I've removed it and instead put the check directly in the assert.
1 parent 7870521 commit 729e25d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/BlocksRuntime/runtime.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,18 +468,16 @@ static void _Block_byref_assign_copy(void *dest, const void *arg, const int flag
468468
// Old compiler SPI
469469
static void _Block_byref_release(const void *arg) {
470470
struct Block_byref *byref = (struct Block_byref *)arg;
471-
int32_t refcount;
472471

473472
// dereference the forwarding pointer since the compiler isn't doing this anymore (ever?)
474473
byref = byref->forwarding;
475-
474+
476475
// To support C++ destructors under GC we arrange for there to be a finalizer for this
477476
// by using an isa that directs the code to a finalizer that calls the byref_destroy method.
478477
if ((byref->flags & BLOCK_BYREF_NEEDS_FREE) == 0) {
479478
return; // stack or GC or global
480479
}
481-
refcount = byref->flags & BLOCK_REFCOUNT_MASK;
482-
os_assert(refcount);
480+
os_assert(byref->flags & BLOCK_REFCOUNT_MASK);
483481
if (latching_decr_int_should_deallocate(&byref->flags)) {
484482
if (byref->flags & BLOCK_BYREF_HAS_COPY_DISPOSE) {
485483
struct Block_byref_2 *byref2 = (struct Block_byref_2 *)(byref+1);

0 commit comments

Comments
 (0)