C# Class GSF.IO.Unmanaged.Memory

This class is used to allocate and free unmanaged memory. To release memory allocated throught this class, call the Dispose method of the return value.
.NET does not respond well when managing tens of GBs of ram. If a very large buffer pool must be created, it would be good to allocate that buffer pool in unmanaged memory.
Inheritance: IDisposable
Datei anzeigen Open project: GridProtectionAlliance/openHistorian

Public Methods

Method Description
Clear ( IntPtr pointer, int length ) : void

Sets the data in this buffer to all zeroes

Clear ( byte pointer, int length ) : void

Sets the data in this buffer to all zeroes

Copy ( IntPtr src, IntPtr dest, int count ) : void

Does a safe copy of data from one location to another. A safe copy allows for the source and destination to overlap.

Copy ( byte src, byte dest, int count ) : void

Does a safe copy of data from one location to another. A safe copy allows for the source and destination to overlap.

Dispose ( ) : void

Releases all the resources used by the Memory object.

Memory ( int requestedSize ) : System

Allocates unmanaged memory. The block is uninitialized.

Release ( ) : void

Releases the allocated memory back to the OS. Same thing as calling Dispose().

Method Details

Clear() public static method

Sets the data in this buffer to all zeroes
public static Clear ( IntPtr pointer, int length ) : void
pointer System.IntPtr the starting position.
length int the number of bytes to clear.
return void

Clear() public static method

Sets the data in this buffer to all zeroes
public static Clear ( byte pointer, int length ) : void
pointer byte the starting position.
length int the number of bytes to clear.
return void

Copy() public static method

Does a safe copy of data from one location to another. A safe copy allows for the source and destination to overlap.
public static Copy ( IntPtr src, IntPtr dest, int count ) : void
src System.IntPtr
dest System.IntPtr
count int
return void

Copy() public static method

Does a safe copy of data from one location to another. A safe copy allows for the source and destination to overlap.
public static Copy ( byte src, byte dest, int count ) : void
src byte
dest byte
count int
return void

Dispose() public method

Releases all the resources used by the Memory object.
public Dispose ( ) : void
return void

Memory() public method

Allocates unmanaged memory. The block is uninitialized.
public Memory ( int requestedSize ) : System
requestedSize int The desired number of bytes to allocate. /// Be sure to check the actual size in the return class.
return System

Release() public method

Releases the allocated memory back to the OS. Same thing as calling Dispose().
public Release ( ) : void
return void