API reference
Constructor MemoryBuffer
- Namespace
- DisCatSharp.Common.Types
- Assembly
- DisCatSharp.Common.dll
MemoryBuffer(int, int, MemoryPool<byte>?, bool)
Creates a new buffer with a specified segment size, specified number of initially-allocated segments, and supplied memory pool.
public MemoryBuffer(int segmentSize = 65536, int initialSegmentCount = 0, MemoryPool<byte>? memPool = null, bool clearOnDispose = false)
Parameters
segmentSizeintByte size of an individual segment. Defaults to 64KiB.
initialSegmentCountintNumber of segments to allocate. Defaults to 0.
memPoolMemoryPool<byte>Memory pool to use for renting buffers. Defaults to Shared.
clearOnDisposeboolDetermines whether the underlying buffers should be cleared on exit. If dealing with sensitive data, it might be a good idea to set this option to true.