summaryrefslogtreecommitdiffstats
path: root/vm/Misc.c
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-11-12 18:45:15 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-11-12 18:45:15 -0800
commit72e93344b4d1ffc71e9c832ec23de0657e5b04a5 (patch)
tree1a08d1e43d54200ea737234d865c4668c5d3535b /vm/Misc.c
parentdfd0afbcb08b871e224a28ecb4ed427a7693545c (diff)
downloadandroid_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.tar.gz
android_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.tar.bz2
android_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.zip
eclair snapshot
Diffstat (limited to 'vm/Misc.c')
-rw-r--r--vm/Misc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/vm/Misc.c b/vm/Misc.c
index ef9c4afa6..f8f72567f 100644
--- a/vm/Misc.c
+++ b/vm/Misc.c
@@ -280,6 +280,7 @@ bool dvmSetBit(BitVector* pBits, int num)
pBits->storage = realloc(pBits->storage, newSize * sizeof(u4));
memset(&pBits->storage[pBits->storageSize], 0x00,
(newSize - pBits->storageSize) * sizeof(u4));
+ pBits->storageSize = newSize;
}
pBits->storage[num >> 5] |= 1 << (num & 0x1f);
@@ -297,6 +298,15 @@ void dvmClearBit(BitVector* pBits, int num)
}
/*
+ * Mark all bits bit as "clear".
+ */
+void dvmClearAllBits(BitVector* pBits)
+{
+ int count = pBits->storageSize;
+ memset(pBits->storage, 0, count * sizeof(u4));
+}
+
+/*
* Determine whether or not the specified bit is set.
*/
bool dvmIsBitSet(const BitVector* pBits, int num)
@@ -334,7 +344,6 @@ int dvmCountSetBits(const BitVector* pBits)
return count;
}
-
/*
* Return a newly-allocated string in which all occurrences of '.' have
* been changed to '/'. If we find a '/' in the original string, NULL