C# Класс 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.
Наследование: IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
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().

Описание методов

Clear() публичный статический Метод

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.
Результат void

Clear() публичный статический Метод

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.
Результат void

Copy() публичный статический Метод

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
Результат void

Copy() публичный статический Метод

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
Результат void

Dispose() публичный Метод

Releases all the resources used by the Memory object.
public Dispose ( ) : void
Результат void

Memory() публичный Метод

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.
Результат System

Release() публичный Метод

Releases the allocated memory back to the OS. Same thing as calling Dispose().
public Release ( ) : void
Результат void