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;
}
{
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();
}
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,
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();
}