diff options
author | Ovidiu Predescu <ovidiu@aracnet.com> | 1998-09-02 23:48:01 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-09-02 17:48:01 -0600 |
commit | d8bb17c8e33975277dd5231e190bf99451b7025d (patch) | |
tree | 1c3b607110323b831606c2ec27d39a0f292a1a15 /gcc/objc/objects.c | |
parent | d636ae0b801758df397e3e1ee790ed041a48b9f9 (diff) | |
download | gcc-d8bb17c8e33975277dd5231e190bf99451b7025d.zip gcc-d8bb17c8e33975277dd5231e190bf99451b7025d.tar.gz gcc-d8bb17c8e33975277dd5231e190bf99451b7025d.tar.bz2 |
Boehm GC support for ObjC from Ovidiu Predescu.
From-SVN: r22199
Diffstat (limited to 'gcc/objc/objects.c')
-rw-r--r-- | gcc/objc/objects.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/objc/objects.c b/gcc/objc/objects.c index 3e68334..d079c5d 100644 --- a/gcc/objc/objects.c +++ b/gcc/objc/objects.c @@ -25,8 +25,13 @@ Boston, MA 02111-1307, USA. */ covered by the GNU General Public License. */ #include "../tconfig.h" /* include defs of bzero for target */ +#include "objc.h" #include "runtime.h" /* the kitchen sink */ +#if OBJC_WITH_GC +# include <gc.h> +#endif + id __objc_object_alloc(Class); id __objc_object_dispose(id); id __objc_object_copy(id); @@ -39,8 +44,16 @@ id class_create_instance(Class class) { id new = nil; + +#if OBJC_WITH_GC + if (CLS_ISCLASS(class)) + new = (id)GC_malloc_explicitly_typed (class->instance_size, + class->gc_object_type); +#else if (CLS_ISCLASS(class)) new = (*_objc_object_alloc)(class); +#endif + if (new!=nil) { memset (new, 0, class->instance_size); |