Create Heap and destroy Heap : Memory : Windows C# Examples


C# Examples » Windows » Memory »

 

Create Heap and destroy Heap









    
using  System;
using  System.Runtime.InteropServices;

public  sealed  class  MainClass
{
        [DllImport("kernel32.dll")]
        static  extern  IntPtr  HeapCreate(uint  flOptions,  UIntPtr  dwInitialSize,UIntPtr  dwMaximumSize);

        [DllImport("kernel32.dll")]
        static  extern  bool  HeapDestroy(IntPtr  hHeap);

        public  static  void  Main()  {
                IntPtr  theHeap  =  HeapCreate(  0,  (UIntPtr)  4096,  UIntPtr.Zero  );
                HeapDestroy(  theHeap  );
                theHeap  =  IntPtr.Zero;
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Windows
» Memory