SodiumAllocator class
An Allocator using the libsodium memory functionality.
- Implemented types
- Available extensions
Constructors
- SodiumAllocator(LibSodiumFFI sodium)
-
Default constructor
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sodium → LibSodiumFFI
-
The
LibSodiumFFI
instance used by this allocator.final
Methods
-
allocate<
T extends NativeType> (int byteCount, {int? alignment}) → Pointer< T> -
Provides sodium_malloc.
override
-
call<
T extends SizedNativeType> ([int count = 1]) → Pointer< T> -
Available on Allocator, provided by the AllocatorAlloc extension
AllocatessizeOf<T>() * count
bytes of memory using allocate. -
free(
Pointer< NativeType> pointer) → void -
Provides sodium_free.
override
-
lock(
Pointer< NativeType> pointer, int byteCount) → bool - Provides sodium_mlock.
-
memoryProtect(
Pointer< NativeType> pointer, MemoryProtection memoryProtection) → bool - Provides sodium_mprotect_*.
-
memzero(
Pointer< NativeType> pointer, int byteCount) → void - Provides sodium_memzero.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unlock(
Pointer< NativeType> pointer, int byteCount) → bool - Provides sodium_munlock.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited