Memory Class

This class is used to allocate and free unmanaged memory. To release memory allocated through this class, call the Dispose() method of the return value.

Definition

Namespace: SnapDB.IO.Unmanaged
Assembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public sealed class Memory : IDisposable
Inheritance
Object    Memory
Implements
IDisposable

Constructors

Memory Allocates unmanaged memory. The block is uninitialized.

Properties

Address The pointer to the first byte of this unmanaged memory. Equals Zero if memory has been released.
Size The number of bytes in this allocation.

Methods

Clear(Byte*, Int32) Sets the data in this buffer to all zeroes.
Clear(IntPtr, Int32) Sets the data in this buffer to all zeroes.
Copy(Byte*, Byte*, Int32) Does a safe copy of data from one location to another. A safe copy allows for the source and destination to overlap.
Copy(IntPtr, IntPtr, Int32) Does a safe copy of data from one location to another. A safe copy allows for the source and destination to overlap.
Dispose Releases all the resources used by the Memory object.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize Releases the unmanaged resources before the Memory object is reclaimed by GC.
(Overrides ObjectFinalize)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
Release Releases the allocated memory back to the OS. Same thing as calling Dispose().
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also