Skip to content

Commit

Permalink
Remove Boehm GC support code.
Browse files Browse the repository at this point in the history
This removes all support for GC mode.

This was deprecated by Apple in OS X 10.8 (2012) and never supported in
iOS.  Very little code ever tried to use it with this runtime.

It's gone from the build system already.
  • Loading branch information
davidchisnall committed Feb 19, 2023
1 parent e23882f commit b3f7b1b
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 800 deletions.
15 changes: 1 addition & 14 deletions abi_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ static int known_abi_count =
}\
} while(0)

PRIVATE enum objc_gc_mode current_gc_mode = GC_Optional;

static BOOL endsWith(const char *string, const char *suffix)
{
if (NULL == string) { return NO; }
Expand Down Expand Up @@ -125,19 +123,8 @@ PRIVATE BOOL objc_check_abi_version(struct objc_module_abi_8 *module)
max_loaded_version = version;
}

// If we're currently in GC-optional mode, then fall to one side or the
// other if this module requires / doesn't support GC
if (current_gc_mode == GC_Optional)
{
current_gc_mode = gc_mode;
if (gc_mode == GC_Required)
{
enableGC(NO);
}
}
// We can't mix GC_None and GC_Required code, but we can mix any other
// combination
FAIL_IF((gc_mode == GC_Required) && (gc_mode != current_gc_mode),
"Attempting to mix GC and non-GC code!");
FAIL_IF((gc_mode == GC_Required), "GC code is no longer supported!");
return YES;
}
10 changes: 2 additions & 8 deletions blocks_runtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ OBJC_PUBLIC void _Block_object_assign(void *destAddr, const void *object, const
id src = (id)object;
void **dst = destAddr;
*dst = src;
if (!isGCEnabled)
{
*dst = objc_retain(src);
}
*dst = objc_retain(src);
}
}
}
Expand Down Expand Up @@ -234,10 +231,7 @@ OBJC_PUBLIC void _Block_object_dispose(const void *object, const int flags)
!IS_SET(flags, BLOCK_BYREF_CALLER))
{
id src = (id)object;
if (!isGCEnabled)
{
objc_release(src);
}
objc_release(src);
}
}
}
Expand Down
Loading

0 comments on commit b3f7b1b

Please sign in to comment.