Default Marshaling Behavior
Interop marshaling operates on rules that dictate how data associated with method parameters behaves as it passes between managed and unmanaged memory. These built-in rules control such marshaling activities as data type transformations, whether a callee can change data passed to it and return those changes to the caller, and under which circumstances the marshaler provides performance optimizations.
This section identifies the default behavioral characteristics of the interop marshaling service. It presents detailed information on marshaling arrays, Boolean types, char types, delegates, classes, objects, strings, and structures.
In This Section
- Memory Management
- Describes how the interop marshaler frees memory allocated by unmanaged code.
- Directional Attributes
- Describes the InAttribute and OutAttribute attributes, and when to use them.
- Blittable and Non-Blittable Types
- Describes data types that require conversion when marshaled to unmanaged memory.
- Copying and Pinning
- Describes how copying and pinning affect data marshaling.