Category : C Source Code
Archive   : SEGHEAP.ZIP
Filename : SEGHEAP.DOC

Output of file : SEGHEAP.DOC contained in archive : SEGHEAP.ZIP


by Stephen Chung ([email protected])


These routines are to be used with Microsoft Windows 3.0. The library
implements a segmented heap in global memory space, allocating and freeing
memory blocks of different sizes at the user's request. It solves the
typical Windows problem of not being able to efficiently handle a large
number of small memory blocks allocated globally.


These routines lock a memory handle immediately after allocation. As
a result, they work with PROTECTED MODE ONLY.

I think these routines are OK, but let me know if you find a bug.

How to use

The routines SegHeapAlloc, SegHeapFree and SegHeapRealloc basically
parallel the malloc, free and realloc functions found in standard C
libraries. FreeAllMemory is designed to be used by the end of a program,
when all dynamic memory can be released. MemoryStatistics will
calculate some memory usage statistics.


Theoretically, you are required to obtain special approval from me (because
I copyrighted these routines) if you want to use them in your programs.
However, I usually don't really care if you are not using these routines in
a commercial, shareware etc. product.

Any questions and/or bug fixes, please send email to:

Stephen Chung [email protected]

If it bounces, then try [email protected]

Have fun!