Griff is right (mostly) :)
99.999% of the time, working with objects in .NET you will only use the "new" operator, which works with managed memory.
However, there are rare circumstances that you need to allocate unmanaged memory, just like you would with malloc. .NET does provide a method for doing this with the Marshal class, specifically the
Marshal.AllocHGlobal[
^] and
Marshal.FreeHGlobal[
^].
Its also worth noting that you don't really want to use the above unless you are working with some specialized unmanaged code. Allocating memory and forgetting to free it creates memory leaks.