diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-13 06:41:07 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-13 06:41:07 +0000 |
commit | 4ee9c6840ad3fc92a9034343278a1e476ad6872a (patch) | |
tree | a2568888a519c077427b133de9ece5879a8484a5 /gcc/sbitmap.c | |
parent | ebb338380ab170c91e64d38038e6b5ce930d69a1 (diff) | |
download | gcc-4ee9c6840ad3fc92a9034343278a1e476ad6872a.tar.gz |
Merge tree-ssa-20020619-branch into mainline.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81764 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r-- | gcc/sbitmap.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index 1d27a871097..dfd764528cb 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -103,6 +103,32 @@ sbitmap_resize (sbitmap bmap, unsigned int n_elms, int def) return bmap; } +/* Re-allocate a simple bitmap of N_ELMS bits. New storage is uninitialized. */ + +sbitmap +sbitmap_realloc (sbitmap src, unsigned int n_elms) +{ + unsigned int bytes, size, amt; + sbitmap bmap; + + size = SBITMAP_SET_SIZE (n_elms); + bytes = size * sizeof (SBITMAP_ELT_TYPE); + amt = (sizeof (struct simple_bitmap_def) + + bytes - sizeof (SBITMAP_ELT_TYPE)); + + if (src->bytes >= bytes) + { + src->n_bits = n_elms; + return src; + } + + bmap = (sbitmap) xrealloc (src, amt); + bmap->n_bits = n_elms; + bmap->size = size; + bmap->bytes = bytes; + return bmap; +} + /* Allocate a vector of N_VECS bitmaps of N_ELMS bits. */ sbitmap * |