summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-03-05 14:11:25 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-03-05 14:11:25 +0000
commitbbdad5353f89a9c8dd9ec1e6717f7fd658289655 (patch)
tree282b4722ac3c42ce139b30d8b8ef5e8cf8dc9220
parent164666e6a5d63dd8b7fed6f0442466664d8d3ad2 (diff)
downloadppe42-gcc-bbdad5353f89a9c8dd9ec1e6717f7fd658289655.tar.gz
ppe42-gcc-bbdad5353f89a9c8dd9ec1e6717f7fd658289655.zip
(union sversion): New.
(struct sarray): Maintain multiple versions. (sarray_remove_garbage): Add prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11446 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/objc/sarray.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/objc/sarray.h b/gcc/objc/sarray.h
index a3ec7a98373..7d1ba25290f 100644
--- a/gcc/objc/sarray.h
+++ b/gcc/objc/sarray.h
@@ -1,5 +1,5 @@
/* Sparse Arrays for Objective C dispatch tables
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
Author: Kresten Krab Thorup
@@ -42,6 +42,8 @@ extern const char* __objc_sparse3_id;
#include <stddef.h>
+#include "objc/thread.h"
+
extern int nbuckets; /* for stats */
extern int nindices;
extern int narrays;
@@ -111,16 +113,21 @@ union sofftype {
void * __objc_xrealloc (void *optr, size_t size);
void * __objc_xmalloc (size_t size);
+union sversion {
+ int version;
+ void *next_free;
+};
+
struct sbucket {
void* elems[BUCKET_SIZE]; /* elements stored in array */
- short version; /* used for copy-on-write */
+ union sversion version; /* used for copy-on-write */
};
#ifdef OBJC_SPARSE3
struct sindex {
struct sbucket* buckets[INDEX_SIZE];
- short version;
+ union sversion version; /* used for copy-on-write */
};
#endif /* OBJC_SPARSE3 */
@@ -133,7 +140,7 @@ struct sarray {
struct sbucket** buckets;
#endif /* OBJC_SPARSE2 */
struct sbucket* empty_bucket;
- short version;
+ union sversion version; /* used for copy-on-write */
short ref_count;
struct sarray* is_copy_of;
size_t capacity;
@@ -142,10 +149,12 @@ struct sarray {
struct sarray* sarray_new(int, void* default_element);
void sarray_free(struct sarray*);
struct sarray* sarray_lazy_copy(struct sarray*);
-struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
void sarray_realloc(struct sarray*, int new_size);
void sarray_at_put(struct sarray*, sidx index, void* elem);
void sarray_at_put_safe(struct sarray*, sidx index, void* elem);
+
+struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
+void sarray_remove_garbage(void);
#ifdef PRECOMPUTE_SELECTORS
OpenPOWER on IntegriCloud