Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>hfree() deallocate huge memory block</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 hfree()                 Deallocate Huge Memory Block

 #include   <malloc.h>                   Required for declarations only

 void       hfree(ptr);
 void huge  *ptr;                        Pointer to already allocated
                                         huge memory block

    hfree() deallocates the previously allocated huge memory block
    pointed to by 'ptr'. This makes the memory in the block available for
    allocation. The block must have been allocated by halloc().

    Returns:    Nothing

      Notes:    Do not use halloc() to free a 'ptr' not allocated by
                halloc() because subsequent allocation errors may occur.

                Use free() to free memory allocated by malloc(),
                calloc(), or realloc().

                Use _ffree() to free memory allocated by _fmalloc().

                Use _nfree() to free memory allocated by _nmalloc().

 Portability:   Applies to MS DOS only.

 -------------------------------- Example ---------------------------------

    The following statements allocate space for 50000 long integers and
    then free the allocated space.

           #include <malloc.h>
           #include <stdio.h>      /* for printf and NULL */

           long huge *huge_memptr;

           main()
           {
               if ((huge_memptr = (long huge *) halloc(50000L,
                        sizeof(long))) == NULL)
                    printf("not enough memory for array\n");
               else {
                    .
                    .
                    hfree(huge_memptr);
                }
           }



See Also: halloc() free()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson