OSDN Git Service

Invert sense of a test.
[android-x86/dalvik.git] / vm / BitVector.cpp
index 0ef6f60..8b1d141 100644 (file)
@@ -42,8 +42,7 @@ BitVector* dvmAllocBitVector(unsigned int startBits, bool expandable)
 
     bv->storageSize = count;
     bv->expandable = expandable;
-    bv->storage = (u4*) malloc(count * sizeof(u4));
-    memset(bv->storage, 0x00, count * sizeof(u4));
+    bv->storage = (u4*) calloc(count, sizeof(u4));
     return bv;
 }
 
@@ -104,7 +103,7 @@ void dvmSetBit(BitVector* pBits, unsigned int num)
 {
     if (num >= pBits->storageSize * sizeof(u4) * 8) {
         if (!pBits->expandable) {
-            LOGE("Attempt to set bit outside valid range (%d, limit is %d)",
+            ALOGE("Attempt to set bit outside valid range (%d, limit is %d)",
                 num, pBits->storageSize * sizeof(u4) * 8);
             dvmAbort();
         }
@@ -114,7 +113,7 @@ void dvmSetBit(BitVector* pBits, unsigned int num)
         assert(newSize > pBits->storageSize);
         pBits->storage = (u4*)realloc(pBits->storage, newSize * sizeof(u4));
         if (pBits->storage == NULL) {
-            LOGE("BitVector expansion to %d failed", newSize * sizeof(u4));
+            ALOGE("BitVector expansion to %d failed", newSize * sizeof(u4));
             dvmAbort();
         }
         memset(&pBits->storage[pBits->storageSize], 0x00,
@@ -206,7 +205,7 @@ int dvmCountSetBits(const BitVector* pBits)
 static void checkSizes(const BitVector* bv1, const BitVector* bv2)
 {
     if (bv1->storageSize != bv2->storageSize) {
-        LOGE("Mismatched vector sizes (%d, %d)",
+        ALOGE("Mismatched vector sizes (%d, %d)",
             bv1->storageSize, bv2->storageSize);
         dvmAbort();
     }