Wrappers for raw data located in unmanaged memory.
Using the Data type will only place a small object in managed memory, keeping the actual data in unmanaged memory. A proxy class (DataWrapper) is used to safely allow multiple references to the same block of unmanaged memory. When the DataWrapper object is destroyed (either manually or by the garbage collector when there are no remaining Data references), the unmanaged memory is deallocated.
This has the following advantage over using managed memory:
On the other hand, using Data has the following disadvantages:
Base abstract class which owns a block of memory.
Set threshold of allocated memory to trigger a garbage collection.
Delete a class instance created with unmanagedNew.
Allocate and construct a new class in malloc'd memory.
How many allocations have been done so far.
How many DataWrapper instances there are live currently.
How many bytes are currently in Data-owned memory.
Wrapper for data located in external memory, to prevent faux references. Represents a slice of data, which may or may not be in unmanaged memory. Data in unmanaged memory is bound to a DataWrapper class instance.