handle vector types in calcAllocatedSize