Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Util.Memory

Description

Utilities dealing with memory usage.

TODO the SizeOf part can maybe be replaced by the weigh package.

Synopsis

Size

newtype Size Source #

Size in bytes.

Constructors

Size Integer 

Instances

Instances details
Num Size Source # 
Instance details

Defined in Util.Memory

Methods

(+) :: Size -> Size -> Size #

(-) :: Size -> Size -> Size #

(*) :: Size -> Size -> Size #

negate :: Size -> Size #

abs :: Size -> Size #

signum :: Size -> Size #

fromInteger :: Integer -> Size #

Show Size Source # 
Instance details

Defined in Util.Memory

Methods

showsPrec :: Int -> Size -> ShowS #

show :: Size -> String #

showList :: [Size] -> ShowS #

Eq Size Source # 
Instance details

Defined in Util.Memory

Methods

(==) :: Size -> Size -> Bool #

(/=) :: Size -> Size -> Bool #

Ord Size Source # 
Instance details

Defined in Util.Memory

Methods

compare :: Size -> Size -> Ordering #

(<) :: Size -> Size -> Bool #

(<=) :: Size -> Size -> Bool #

(>) :: Size -> Size -> Bool #

(>=) :: Size -> Size -> Bool #

max :: Size -> Size -> Size #

min :: Size -> Size -> Size #

Pretty.Pretty Size Source # 
Instance details

Defined in Util.Memory

fromK :: RealFrac a => a -> Size Source #

fromM :: RealFrac a => a -> Size Source #

SizeOf

class SizeOf a where Source #

Methods

sizeOf :: a -> Size Source #

Instances

Instances details
SizeOf Word.Word8 Source # 
Instance details

Defined in Util.Memory

SizeOf Char Source # 
Instance details

Defined in Util.Memory

Methods

sizeOf :: Char -> Size Source #

SizeOf Double Source # 
Instance details

Defined in Util.Memory

Methods

sizeOf :: Double -> Size Source #

SizeOf Float Source # 
Instance details

Defined in Util.Memory

Methods

sizeOf :: Float -> Size Source #

SizeOf Int Source # 
Instance details

Defined in Util.Memory

Methods

sizeOf :: Int -> Size Source #

SizeOf a => SizeOf [a] Source # 
Instance details

Defined in Util.Memory

Methods

sizeOf :: [a] -> Size Source #

(SizeOf k, SizeOf a) => SizeOf (Map k a) Source # 
Instance details

Defined in Util.Memory

Methods

sizeOf :: Map k a -> Size Source #

boxedStorable :: Storable a => a -> Size Source #

Boxed word-sized datatype.

usage

rssVsize :: IO (Size, Size) Source #

Return OS-reported (RSS, VSIZE).

RTS

rtsAllocated :: IO Size Source #

Allocated memory according to the GHC RTS.