aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-09-22 10:36:08 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-09-22 10:36:08 -0400
commitd2ca2ea6e8f35b33135a049e22ae3f022947f489 (patch)
treeef8914bc3a3a9060cb3a83c4fd78b66eefacdd04 /gcc
parent79236a0da5f94524f06a7175027c2dee82681384 (diff)
downloadgcc-d2ca2ea6e8f35b33135a049e22ae3f022947f489.zip
gcc-d2ca2ea6e8f35b33135a049e22ae3f022947f489.tar.gz
gcc-d2ca2ea6e8f35b33135a049e22ae3f022947f489.tar.bz2
(_objc_malloc): New function pointer.
(_objc_atomic_malloc, _objc_valloc): Likewise. (_objc_realloc, _objc_calloc, _objc_free): Likewise From-SVN: r12764
Diffstat (limited to 'gcc')
-rw-r--r--gcc/objc/objc-api.h46
1 files changed, 44 insertions, 2 deletions
diff --git a/gcc/objc/objc-api.h b/gcc/objc/objc-api.h
index fdb2076..ff452a4 100644
--- a/gcc/objc/objc-api.h
+++ b/gcc/objc/objc-api.h
@@ -310,12 +310,54 @@ extern Class (*_objc_lookup_class)(const char *name);
*/
extern void (*_objc_load_callback)(Class class, Category* category);
+/*
+** Hook functions for allocating, copying and disposing of instances
+*/
extern id (*_objc_object_alloc)(Class class);
-
extern id (*_objc_object_copy)(id object);
-
extern id (*_objc_object_dispose)(id object);
+/*
+** Standard functions for memory allocation and disposal.
+** Users should use these functions in their ObjC programs so
+** that they work properly with garbage collectors as well as
+** can take advantage of the exception/error handling available.
+*/
+void *
+objc_malloc(size_t size);
+
+void *
+objc_atomic_malloc(size_t size);
+
+void *
+objc_valloc(size_t size);
+
+void *
+objc_realloc(void *mem, size_t size);
+
+void *
+objc_calloc(size_t nelem, size_t size);
+
+void
+objc_free(void *mem);
+
+/*
+** Hook functions for memory allocation and disposal.
+** This makes it easy to substitute garbage collection systems
+** such as Boehm's GC by assigning these function pointers
+** to the GC's allocation routines. By default these point
+** to the ANSI standard malloc, realloc, free, etc.
+**
+** Users should call the normal objc routines above for
+** memory allocation and disposal within their programs.
+*/
+extern void *(*_objc_malloc)(size_t);
+extern void *(*_objc_atomic_malloc)(size_t);
+extern void *(*_objc_valloc)(size_t);
+extern void *(*_objc_realloc)(void *, size_t);
+extern void *(*_objc_calloc)(size_t, size_t);
+extern void (*_objc_free)(void *);
+
Method_t class_get_class_method(MetaClass class, SEL aSel);
Method_t class_get_instance_method(Class class, SEL aSel);