@@ -455,9 +455,9 @@ reallocWith :: forall m a. (MonadIO m , Storable a) =>
455455 -> Int
456456 -> Array a
457457 -> m (Array a)
458−reallocWith label allocSize reqSize arr = do
458+reallocWith label sizer reqSize arr = do
459459 let oldSize = aEnd arr `minusPtr` unsafeForeignPtrToPtr (aStart arr)
460− newSize = allocSize oldSize
460+ newSize = sizer oldSize
461461 safeSize = max newSize (oldSize + reqSize)
462462 rounded = roundUpLargeArray safeSize
463463 assert (newSize >= oldSize + reqSize || error badSize) (return ())
@@ -480,17 +480,17 @@ snocWithRealloc :: forall m a. (MonadIO m, Storable a) =>
480480 -> Array a
481481 -> a
482482 -> m (Array a)
483−snocWithRealloc allocSize arr x = do
483+snocWithRealloc sizer arr x = do
484484 let elemSize = sizeOf (undefined :: a)
485− arr1 <- liftIO $ reallocWith "snocWith" allocSize elemSize arr
485+ arr1 <- liftIO $ reallocWith "snocWith" sizer elemSize arr
486486 snocUnsafe arr1 x
487487
488−-- | @snocWith newSize arr elem@ mutates @arr@ to append @elem@, the length of
488+-- | @snocWith sizer arr elem@ mutates @arr@ to append @elem@. The length of
489489-- the array increases by 1.
490490--
491491-- If there is no reserved space available in @arr@ it is reallocated to a size
492−-- in bytes determined by the @newSize oldSize@ function, where @oldSize@ is
493−-- the original size of the array in bytes.
492+-- in bytes determined by the @sizer oldSizeBytes@ function, where
493+-- @oldSizeBytes@ is the original size of the array in bytes.
494494--
495495-- If the new array size is more than 'largeObjectThreshold' we automatically
496496-- round it up to 'blockSize'.