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 - <b>_nfree() deallocate near memory block</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_nfree()                 Deallocate Near Memory Block

 #include   <malloc.h>                   Required for declarations only

 void       _nfree(ptr);
 char near  *ptr;                        Pointer to allocated near memory

    _nfree() deallocates the memory block allocated by _nmalloc() and
    pointed to by 'ptr'.  This makes the memory in the block available
    for allocation.

    Returns:    There is no return value.

      Notes:    Use free() to free memory allocated by malloc(),
                calloc(), or realloc(). Use _ffree() to free memory
                allocated by _fmalloc(). Use hfree() to free memory
                allocated by halloc().

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

    The following statements allocate space for 1000 bytes in the default
    data segment and then free the allocated space:

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

           char near *near_memptr;

           main()
           {
               if ((near_memptr = _nmalloc(1000)) == NULL)
                    printf("not enough room to allocate memory\n");
               else {
                    .
                    .
                    _nfree(near_memptr);
                }
           }

See Also: _nmalloc() free() malloc() _ffree()

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