Category Archive for: Memory Management and Pointers

Unsafe Code

As you have just seen. C. is very good at hiding much of the basic memory management from the developer, thanks to the garbage collector and the use of references. However, sometimes you will want direct access to memory. For example, you might want to .access a function in an external (non-.NET) DLL that requires a pointer to…

Read More →

Freeing Unmanaged Resources

The presence of the garbage collector means that you will usually not worry about objects that you no longer need; you will simply allow all references to these objects to go out of scope and allow the garbage collector to free memory as required. However, the garbage collector does not know how to free unmanaged resources (such…

Read More →

Memory Management Under the Hood

One of the advantages of C# programming is that the programmer does not need to worry about detailed memory management; in particular, the garbage collector deals with the problem’ of memory cleanup on your-behalf. The result is that you get something that approximates the efficiency of languages like C++ without the complexity of having to handle memory management yourself…

Read More →

Memory Management and Pointers

This chapter presents 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. A good understanding of memory management and knowledge of the pointer capabilities…

Read More →

Back to Top