diff options
author | obrien <obrien@FreeBSD.org> | 1999-08-26 09:30:50 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-08-26 09:30:50 +0000 |
commit | 0bedf4fb30066e5e1d4342a1d3914dae7d37cba7 (patch) | |
tree | 68d8110b41afd0ebbf39167b1a4918eea667a7c5 /contrib/gcc/objc/sarray.h | |
parent | d4db5fb866b7ad5216abd5047774a3973b9901a9 (diff) | |
download | FreeBSD-src-0bedf4fb30066e5e1d4342a1d3914dae7d37cba7.zip FreeBSD-src-0bedf4fb30066e5e1d4342a1d3914dae7d37cba7.tar.gz |
Virgin import of gcc from EGCS 1.1.2
Diffstat (limited to 'contrib/gcc/objc/sarray.h')
-rw-r--r-- | contrib/gcc/objc/sarray.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/contrib/gcc/objc/sarray.h b/contrib/gcc/objc/sarray.h index a3ec7a9..74fa386 100644 --- a/contrib/gcc/objc/sarray.h +++ b/contrib/gcc/objc/sarray.h @@ -1,7 +1,6 @@ /* Sparse Arrays for Objective C dispatch tables - Copyright (C) 1993, 1995 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup + Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. + Contributed by Kresten Krab Thorup. This file is part of GNU CC. @@ -42,6 +41,8 @@ extern const char* __objc_sparse3_id; #include <stddef.h> +#include "objc/thr.h" + extern int nbuckets; /* for stats */ extern int nindices; extern int narrays; @@ -108,19 +109,21 @@ union sofftype { #endif /* not PRECOMPUTE_SELECTORS */ -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 +136,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 +145,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 |