ext/numo/narray/gen/tmpl_bit/allocate.c in numo-narray-0.9.0.3 vs ext/numo/narray/gen/tmpl_bit/allocate.c in numo-narray-0.9.0.4
- old
+ new
@@ -8,10 +8,10 @@
switch(NA_TYPE(na)) {
case NARRAY_DATA_T:
ptr = NA_DATA_PTR(na);
if (na->size > 0 && ptr == NULL) {
- ptr = xmalloc(((na->size-1)/sizeof(BIT_DIGIT)+1)*sizeof(BIT_DIGIT)/8);
+ ptr = xmalloc(((na->size-1)/8/sizeof(BIT_DIGIT)+1)*sizeof(BIT_DIGIT));
NA_DATA_PTR(na) = ptr;
}
break;
//case NARRAY_FILEMAP_T:
// to be implemented