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

 #include<malloc.h>                      Required for declarations only

 void       _ffree(ptr);
 char far   *ptr;                        Pointer to allocated far memory

    _ffree()  deallocates a memory block allocated by _fmalloc() and
    pointed to by 'ptr'.  (_fmalloc() allocates far memory blocks.)  This
    makes the memory in the block available for reallocation.

    Returns:    There is no return value.

      Notes:    The same number of bytes that were allocated by the call
                to _fmalloc() are deallocated by ffree().

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

                Use hfree() to free memory allocated by halloc().

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

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

    The following statements allocate space for 1000 bytes outside the
    default data segment, then free the allocated space.

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

           char far *far_memptr;

           main()
           {
               if ((far_memptr = _fmalloc(1000)) == NULL)
                    printf("not enough room to allocate memory\n");
               else {
                    . . .                 /* Use the memory... */
                    .
                    _ffree(far_memptr);   /* ...then free the memory */
               }
           }

See Also: _fmalloc() free() malloc() _nfree() hfree()

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