streamly-core-0.1.0: Streaming, parsers, arrays and more
Copyright(c) 2020 Composewell Technologies
LicenseBSD-3-Clause
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Streamly.Internal.System.IO

Description

 
Synopsis

Documentation

defaultChunkSize :: Int Source #

Default maximum buffer size in bytes, for reading from and writing to IO devices, the value is 32KB minus GHC allocation overhead, which is a few bytes, so that the actual allocation is 32KB.

arrayPayloadSize :: Int -> Int Source #

When we allocate a byte array of size k the allocator actually allocates memory of size k + byteArrayOverhead. arrayPayloadSize n returns the size of the array in bytes that would result in an allocation of n bytes.

byteArrayOverhead :: Int Source #

Returns the heap allocation overhead for allocating a byte array. Each heap object contains a one word header. Byte arrays contain the size of the array after the header.

See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts/storage/heap-objects#arrays