O'Reilly logo

Windows® CE 3.0 Application Programming by Marshall Brain, Nick Grattan

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

Creating Your Own Heaps

You should consider creating your own heap for memory allocation if you want to do either of the following:

  • Make lots of memory allocations that will all be deleted at the same time

  • Make lots of memory allocations of the same size

As described earlier, the default heap cannot be deleted, and so fragmentation can cause memory problems if the process executes over a long period of time. By using your own heaps, you can delete the heap periodically and therefore effectively remove fragmentation and memory wastage.

A new heap can be created using the function HeapCreate. This function is passed a serialization option, the initial size for the heap, and the maximum size of heap. All heaps are serialized and the initial size ...

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