diff options
Diffstat (limited to 'src/packedintarray.cpp')
-rw-r--r-- | src/packedintarray.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/packedintarray.cpp b/src/packedintarray.cpp index 0e137bf..badc829 100644 --- a/src/packedintarray.cpp +++ b/src/packedintarray.cpp | |||
@@ -31,12 +31,13 @@ PackedIntArray::PackedIntArray( PackedIntArray::Unit iBitWidth ) : | |||
31 | PackedIntArray::PackedIntArray( PackedIntArray::Unit iBitWidth, int iCount ): | 31 | PackedIntArray::PackedIntArray( PackedIntArray::Unit iBitWidth, int iCount ): |
32 | iBitWidth( iBitWidth ), | 32 | iBitWidth( iBitWidth ), |
33 | aData( NULL ), | 33 | aData( NULL ), |
34 | iCapacity( StoreCount(iCount) ), | 34 | iCapacity( bitsizeof(StoreCount(iCount))/iBitWidth ), |
35 | iCount( iCount ), | 35 | iCount( iCount ), |
36 | uMask( 0 ) | 36 | uMask( 0 ) |
37 | { | 37 | { |
38 | aData = new Store[StoreCount(iCapacity)]; | 38 | int iSize = StoreCount(iCapacity); |
39 | memset( aData, 0, StoreCount(iCapacity)); | 39 | aData = new Store[iSize]; |
40 | memset( aData, 0, iSize*sizeof(Store)); | ||
40 | for( int j = 0; j < iBitWidth; j++ ) | 41 | for( int j = 0; j < iBitWidth; j++ ) |
41 | uMask |= (1<<j); | 42 | uMask |= (1<<j); |
42 | } | 43 | } |