Chapter 11: Memory Management and Pointers


Overview

This chapter looks at various aspects of memory management and memory access. Although the runtime takes much of the responsibility for memory management away from the programmer, it is useful to understand how memory management works and important to know how to work with unmanaged resources efficiently.

If you have a good understanding of memory management and knowledge of the pointer capabilities provided by C#, you are also better positioned to integrate C# code with legacy code and perform efficient memory manipulation in performance-critical systems.

Specifically, this chapter discusses:

  • How the runtime allocates space on the stack and the heap

  • How garbage collection works

  • How to use destructors and the System.IDisposable interface to ensure unmanaged resources are released correctly

  • The syntax for using pointers in C#

  • How to use pointers to implement high-performance stack-based arrays




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net