O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Pointer

Synopsis

This class allows access to direct pointers to .NET objects through two static methods. Unbox() returns a void* pointer to the passed object and pins it, not allowing the garbage collector to move its place in memory, and Box() returns control over the object to the .NET runtime.

public sealed class Pointer : System.Runtime.Serialization.ISerializable {
// Public Static Methods
   public static method object Box(void *ptr, Type type);  
   public static method void* Unbox(object ptr);  
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required