]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com>
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Oct 2010 16:17:18 +0000 (16:17 +0000)
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Oct 2010 16:17:18 +0000 (16:17 +0000)
        * archive.c: Do not include objc/objc.h.
        * class.c: Do not include objc/objc.h.
        * encoding.c: Include objc/runtime.h, ctype.h and
        objc-private/module-abi-8.h instead of objc/objc-api.h and
        objc/encoding.h.
        * error.c: Do not include objc/objc.h.
        * gc.c: Include tconfig.h and objc/encoding.h only if
        OBJC_WITH_GC.
        * hash.c: Include objc/runtime.h and objc/thr.h instead of
        objc/objc-api.h.  Do not include objc/objc.h.
        * init.c: Do not include objc/objc.h.
        * ivars.c: Include objc/runtime.h, objc-private/module-abi-8.h and
        objc/thr.h instead of objc/objc-api.h.  Do not include
        objc/objc.h.
        * linking.m: Tidied comment.
        * memory.c: Include objc/runtime.h instead of objc/objc-api.h.
        Do not include objc/objc.h.
        * objects.c: Do not include objc/objc.h.
        * objc-sync.c: Include objc/runtime.h instead of objc/objc-api.h.
        * protocols.c: Do not include objc/objc.h.
        * sarray.c: Include objc/runtime.h instead of objc/objc-api.h.  Do
        not include objc/objc.h.
        * selector.c: Do not include objc/objc.h.
        * sendmsg.c: Do not include objc/objc.h.
        * thr.c: Include objc/runtime.h instead of objc/objc-api.h.
        Do not include objc/objc.h.
        * objc/objc-decls.h: Reindented code.
        * objc/runtime.h Include objc-decls.h.  Updated comments.
        (objc_malloc): New.
        (objc_atomic_malloc): New.
        (objc_calloc): New.
        (objc_realloc): New.
        (objc_free): New.
        * objc-private/runtime.h: Updated comments.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165386 138bc75d-0d04-0410-961f-82ee72b054a4

21 files changed:
libobjc/ChangeLog
libobjc/archive.c
libobjc/class.c
libobjc/encoding.c
libobjc/error.c
libobjc/gc.c
libobjc/hash.c
libobjc/init.c
libobjc/ivars.c
libobjc/linking.m
libobjc/memory.c
libobjc/objc-private/runtime.h
libobjc/objc-sync.c
libobjc/objc/objc-decls.h
libobjc/objc/runtime.h
libobjc/objects.c
libobjc/protocols.c
libobjc/sarray.c
libobjc/selector.c
libobjc/sendmsg.c
libobjc/thr.c

index 569d6a69c3afbc96527afc1e9e4b7d368b4a25a0..78467d86d4744a4d2ac87fb33bd644d7519960d7 100644 (file)
@@ -1,3 +1,40 @@
+2010-10-12  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       * archive.c: Do not include objc/objc.h.
+       * class.c: Do not include objc/objc.h.
+       * encoding.c: Include objc/runtime.h, ctype.h and
+       objc-private/module-abi-8.h instead of objc/objc-api.h and
+       objc/encoding.h.
+       * error.c: Do not include objc/objc.h.
+       * gc.c: Include tconfig.h and objc/encoding.h only if
+       OBJC_WITH_GC.
+       * hash.c: Include objc/runtime.h and objc/thr.h instead of
+       objc/objc-api.h.  Do not include objc/objc.h.
+       * init.c: Do not include objc/objc.h.
+       * ivars.c: Include objc/runtime.h, objc-private/module-abi-8.h and
+       objc/thr.h instead of objc/objc-api.h.  Do not include
+       objc/objc.h.
+       * linking.m: Tidied comment.
+       * memory.c: Include objc/runtime.h instead of objc/objc-api.h.
+       Do not include objc/objc.h.
+       * objects.c: Do not include objc/objc.h.
+       * objc-sync.c: Include objc/runtime.h instead of objc/objc-api.h.
+       * protocols.c: Do not include objc/objc.h.
+       * sarray.c: Include objc/runtime.h instead of objc/objc-api.h.  Do
+       not include objc/objc.h.
+       * selector.c: Do not include objc/objc.h.
+       * sendmsg.c: Do not include objc/objc.h.        
+       * thr.c: Include objc/runtime.h instead of objc/objc-api.h.
+       Do not include objc/objc.h.
+       * objc/objc-decls.h: Reindented code.
+       * objc/runtime.h Include objc-decls.h.  Updated comments.
+       (objc_malloc): New.
+       (objc_atomic_malloc): New.
+       (objc_calloc): New.
+       (objc_realloc): New.
+       (objc_free): New.
+       * objc-private/runtime.h: Updated comments.
+       
 2010-10-12  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * Makefile.in (C_SOURCE_FILES): Added protocols.c.
index f36f1b748fb860b282ffb3e3a5838e42030a2b86..b539ca1163ed928f0e5e5d619e259c8576a2a8f7 100644 (file)
@@ -27,7 +27,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "objc-private/common.h"
 #include "objc-private/error.h"
 #include "tconfig.h"
-#include "objc/objc.h"
 #include "objc/objc-api.h"
 #include "objc/hash.h"
 #include "objc/objc-list.h" 
index 727b26f4b97773781388229dbe7e0ecebf666439..75c933ba32f8bf0873ba63a9bdc93d9827da3e54 100644 (file)
@@ -89,7 +89,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "objc-private/common.h"
 #include "objc-private/error.h"
-#include "objc/objc.h"
 #include "objc/objc-api.h"
 #include "objc/thr.h"
 #include "objc-private/runtime.h"            /* the kitchen sink */
index d417b87396eff13bba01cd40f957c2e03a89debc..87517f4eaf85cdcbbbe0612557eb7c58f1322a4d 100644 (file)
@@ -36,9 +36,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "tconfig.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "objc/objc-api.h"
-#include "objc/encoding.h"
+#include "objc/runtime.h"
+#include "objc-private/module-abi-8.h" /* For struct objc_method */
 #include <stdlib.h>
+#include <ctype.h>
 
 #undef  MAX
 #define MAX(X, Y)                    \
index 0dc8fd8dae0f9b84be4345c1cdbfc7150bcf5d41..7c6ba44b76fadb700f4a8f3e42312c5b56b1cb9c 100644 (file)
@@ -48,8 +48,7 @@ _objc_abort (const char *fmt, ...)
 }
 
 /* The rest of the file is deprecated.  */
-#include "objc/objc.h"
-#include "objc/objc-api.h"
+#include "objc/objc-api.h" /* For objc_error_handler.  */
 
 /*
 ** Error handler function
index a67ba1c985531e03f779c8a146ddae002caabff8..ed5effbb437f9071cabcda272ac552c2d6e00a1f 100644 (file)
@@ -24,15 +24,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 #include "objc-private/common.h"
-#include "tconfig.h"
 #include "objc/objc.h"
-#include "objc/encoding.h"
 
+#if OBJC_WITH_GC
+
+#include "tconfig.h"
 #include <assert.h>
 #include <string.h>
 #include <stdlib.h>
-
-#if OBJC_WITH_GC
+#include "objc/encoding.h"
 
 #include <gc.h>
 #include <limits.h>
index 602fc84a87400f0cc066029e6083c7b43c59627f..3ecc54a170a5b42386dcd87af1640b552dd93aa2 100644 (file)
@@ -25,8 +25,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "objc-private/common.h"
 #include <assert.h> /* For assert */
 
-#include "objc/objc.h"
-#include "objc/objc-api.h"
+#include "objc/runtime.h" /* For objc_calloc */
+#include "objc/thr.h"     /* Required by objc-private/runtime.h.  */
 #include "objc-private/hash.h"
 #include "objc-private/runtime.h"              /* for DEBUG_PRINTF */
 
index 9384f5865c35c8125b829e1751b0ffc5ddd1d6b2..0f714c4059661f35f2e57d9e593eec54f6f2c18d 100644 (file)
@@ -26,7 +26,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "objc-private/common.h"
 #include "objc-private/error.h"
-#include "objc/objc.h"
 #include "objc/objc-api.h"
 #include "objc/thr.h"
 #include "objc-private/hash.h"
index 18c6e8af29db44d229a23d08c1812bc9ebf29ca8..061fa211fa8f4c5707d8aaafbd8d1c7d4b9760ad 100644 (file)
@@ -23,8 +23,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 #include "objc-private/common.h"
-#include "objc/objc.h"
-#include "objc/objc-api.h"
+#include "objc/runtime.h"
+#include "objc-private/module-abi-8.h" /* For runtime structures  */
+#include "objc/thr.h"
 #include "objc-private/runtime.h"              /* the kitchen sink */
 #include <string.h> /* For strcmp */
 
index 6372e91df4518d454cd867114c248e085fecba1d..e94c8ea8c4b8247fffabfcbab2281f29e8859e13 100644 (file)
@@ -28,8 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include <objc/NXConstStr.h>
 
 /* Generate references to Object and NXConstanstString classes since they are
-   needed by the runtime system to run correctly. */
-
+   needed by the runtime system to run correctly.  */
 
 void __objc_linking (void)
 {
index a0d6e130ad90266ec1557e131e36ebb871e01fdf..458d2566fcbe68ea453707d1050d0a17992e6e58 100644 (file)
@@ -42,8 +42,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define __USE_FIXED_PROTOTYPES__
 #include <stdlib.h>
 
-#include "objc/objc.h"
-#include "objc/objc-api.h"
+#include "objc/runtime.h"
 
 #if OBJC_WITH_GC
 #include <gc.h>
index 3917c3ef3b03c1de2ef0df3d2b7dfbb1c414f318..b7e75ae4304f072d8eeabfbf8e218888a45d3ca1 100644 (file)
@@ -34,7 +34,8 @@ The original list was:
 
 but can almost certainly be shrinked down.
 
-*/
+Note that you can use this file both with objc/objc-api.h and with
+objc/runtime.h.  */
 
 #ifndef __objc_private_runtime_INCLUDE_GNU
 #define __objc_private_runtime_INCLUDE_GNU
index 97349e64029e0f4ac05482e0b85849cc138a1f57..d01707ca6595da9cfff9590f95cf922fca9330d6 100644 (file)
@@ -79,7 +79,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "objc-private/common.h"
 #include "objc/objc-sync.h"         /* For objc_sync_enter(), objc_sync_exit() */
-#include "objc/objc-api.h"          /* For objc_malloc() */
+#include "objc/runtime.h"           /* For objc_malloc() */
 #include "objc/thr.h"               /* For objc_mutex_loc() and similar */
 #include "objc-private/objc-sync.h" /* For __objc_sync_init() */
 
index e5388e33c4ce69277e66d83b48325a5857bf024d..b3cfb2120f2ac7a436f2c7fcdfdb1dbb5eed5c46 100644 (file)
@@ -28,13 +28,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #if defined (_WIN32) || defined (__WIN32__) || defined (WIN32)
 
-#    ifdef DLL_EXPORT /* defined by libtool (if required) */
-#  define objc_EXPORT 
-#  define objc_DECLARE
-#else
-#  define objc_EXPORT  extern __declspec(dllimport)
-#  define objc_DECLARE extern __declspec(dllimport)
-#endif
+#  ifdef DLL_EXPORT /* defined by libtool (if required) */
+#    define objc_EXPORT 
+#    define objc_DECLARE
+#  else
+#    define objc_EXPORT  extern __declspec(dllimport)
+#    define objc_DECLARE extern __declspec(dllimport)
+#  endif
 
 #else
 
index b5ae87bc7c82489f55d6cd02e622cd3f3f992c6a..6efe78d6fce3db5b21b0d043df23b7c19109a4cb 100644 (file)
@@ -48,6 +48,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 /* TODO: This file is incomplete.  */
 
 #include "objc.h"
+#include "objc-decls.h"
 
 /* An 'Ivar' represents an instance variable.  It holds information
    about the name, type and offset of the instance variable.  */
@@ -543,11 +544,38 @@ struct __objcFastEnumerationState
 */
 
 
+/** Implementation: the following functions are in memory.c.  */
+
+/* Traditional GNU Objective-C Runtime functions that are used for
+   memory allocation and disposal.  These functions are used in the
+   same way as you use malloc, realloc, calloc and free and make sure
+   that memory allocation works properly with the garbage
+   collector.
+
+   Compatibility Note: these functions are not available with the
+   Apple/NeXT runtime.  */
+
+objc_EXPORT void *objc_malloc(size_t size);
+
+/* FIXME: Shouldn't the following be called objc_malloc_atomic ?  The
+   GC function is GC_malloc_atomic() which makes sense.
+ */
+objc_EXPORT void *objc_atomic_malloc(size_t size);
+
+objc_EXPORT void *objc_realloc(void *mem, size_t size);
+
+objc_EXPORT void *objc_calloc(size_t nelem, size_t size);
+
+objc_EXPORT void objc_free(void *mem);
+
+
 /** Implementation: the following functions are in encoding.c.  */
 
 /* Traditional GNU Objective-C Runtime functions that are currently
    used to implement method forwarding.
-*/
+
+   Compatibility Note: these functions are not available with the
+   Apple/NeXT runtime.  */
 
 /* Return the size of a variable which has the specified 'type'
    encoding.  */
index 2562be55f247bb528de170afef524bbc3d0e4b4b..7aaf9a3afa51d57178edf620e9d08e61f30f0745 100644 (file)
@@ -23,7 +23,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 #include "objc-private/common.h"
-#include "objc/objc.h"
 #include "objc/objc-api.h"
 #include "objc-private/runtime.h"              /* the kitchen sink */
 
index af62a2dba3affd169f036550e4c851cafb9a62d6..6d429803c8fd584168ce425d64f006a444090941 100644 (file)
@@ -23,7 +23,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 #include "objc-private/common.h"
-#include "objc/objc.h"
 #include "objc/runtime.h"
 #include "objc-private/module-abi-8.h" /* For runtime structures  */
 #include "objc/thr.h"
index 8d5303701e090585debe15e228f30b0d925ca903..9dd160e51eb68ffb8890d7c06d78810544c62313 100644 (file)
@@ -24,9 +24,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "objc-private/common.h"
 #include "objc-private/sarray.h"
-#include "objc/objc.h"
-#include "objc/objc-api.h"
-#include "objc/thr.h"
+#include "objc/runtime.h" /* For objc_malloc */
+#include "objc/thr.h"     /* For objc_mutex_lock */
 #include "objc-private/runtime.h"
 #include <stdio.h>
 #include <string.h> /* For memset */
index 0c12130ae3807dcaaaefb5906a6f881d8557a9de..1d4bc7e69d73275f50ebffde80ba3803ef880181 100644 (file)
@@ -23,7 +23,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 #include "objc-private/common.h"
-#include "objc/objc.h"
 #include "objc/objc-api.h"
 #include "objc/thr.h"
 #include "objc-private/hash.h"
index a822af4a31a20d368b93e0315e65feb744bab804..02be39c5b0528d3e70d8e3ac64253d6cdd7dacaa 100644 (file)
@@ -33,7 +33,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "tconfig.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "objc/objc.h"
 #include "objc/objc-api.h"
 #include "objc/thr.h"
 #include "objc-private/runtime.h"
index 50196e81c583ae932bb255044926e3eb3066e194..609872d3d1751bfcb0d2ebdd92faf0dc079f9226 100644 (file)
@@ -38,8 +38,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "tm.h"
 #include "defaults.h"
 #include "objc/thr.h"
-#include "objc/objc.h"
-#include "objc/objc-api.h"
+#include "objc/runtime.h"
 #include "objc-private/runtime.h"
 #include <gthr.h>