Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
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.