|Maintainer||Bas van Dijk <firstname.lastname@example.org>|
- module Control.Monad.Trans.Region
- data RegionalPtr α r
- nullPtr :: NullPtr α RootRegion
- data NullPtr α r
- class Pointer pointer where
- class PrivateAllocatedPointer pointer => AllocatedPointer pointer
- castPtr :: Pointer pointer => pointer α r -> pointer β r
- alignPtr :: AllocatedPointer pointer => pointer α r -> Int -> pointer α r
- plusPtr :: AllocatedPointer pointer => pointer α r -> Int -> pointer β r
- minusPtr :: AllocatedPointer pointer => pointer α r1 -> pointer β r2 -> Int
Note that this module re-exports the
regions package which allows you to run regions using
and duplicate a
RegionalPtr to a parent region using
A regional pointer to memory.
This should provide a safer replacement for
nullPtr is a pointer which is not associated with a valid
nullPtr is a pure value. This means it does not perform the
side-effect of registering a finalizer like "
Class of pointers
Apply a pure function to the inner pointer of a regional pointer.
Class of pointers which point to allocated memory.
NullPtr is the only
pointer which is not an instance of this class.
The super class
PrivateAllocatedPointer is not exported by this module
which ensures you can't accidentally make
NullPtr an instance of this class.
Pure functions on pointers
castPtr function casts a pointer from one type to another.
Given an arbitrary address and an alignment constraint,
the next higher address that fulfills the alignment constraint. An alignment
x is fulfilled by any address divisible by
x. This operation
Advances the given address by the given offset in bytes.