UnmanagedBuffer Class |
Namespace: Ookii.Jumbo
The UnmanagedBuffer type exposes the following members.
Name | Description | |
---|---|---|
UnmanagedBuffer(Int32) |
Initializes a new instance of the UnmanagedBuffer class.
| |
UnmanagedBuffer(Int64) |
Initializes a new instance of the UnmanagedBuffer class.
|
Name | Description | |
---|---|---|
Buffer |
Gets a pointer to the first byte of the buffer.
| |
Size |
Gets the size of the buffer.
|
Name | Description | |
---|---|---|
Copy(Byte, Int32, UnmanagedBuffer, Int32, Int32) |
Copies data from a managed array to the buffer.
| |
Copy(UnmanagedBuffer, Int32, Byte, Int32, Int32) |
Copies data from a buffer to a managed array.
| |
CopyCircular(Byte, Int32, UnmanagedBuffer, Int64, Int32) |
Copies data from a managed array to the buffer, wrapping around if necessary.
| |
CopyCircular(UnmanagedBuffer, Int64, Byte, Int32, Int32) |
Copies data from a circular buffer to a managed array.
| |
Dispose |
Releases all resources used by this class.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize |
Releases all resources used by this class.
(Overrides ObjectFinalize.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Resize |
Resizes the buffer.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
This class is used as an alternative for byte[]. The main differences are that the memory is returned to the OS when the class is disposed/finalized, and the buffer is not zero-initialized.
The main reason for the existence of this class is Mono's reluctance to release memory from the managed heap back to the OS which can lead to pagefile thrashing if you're dealing with many large buffers. This problem may not apply to the sgen garbage collector, but this has not been tested.