Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>farfree() free a block from far heap</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 farfree()               Free a Block from Far Heap

 #include   <alloc.h>

 void     farfree(block);
 void far *block;                        Block of memory

    farfree() frees a block of memory previously allocated from the far
    heap. In small and medium memory models, farfree() must be used to
    free blocks of memory allocated by farmalloc(), but cannot be used to
    free blocks of memory allocated by malloc().  The two heaps are
    totally distinct in these models.

       Returns:     Nothing.

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

    The following statements allocate space for 1000 bytes then free the
    allocated space.

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

           char far *far_ptr;

           main()
           {
               if ((far_ptr = farmalloc(1000L)) == NULL)
                    printf("not enough room to allocate memory\n");
               else {
                    . . .                 /* Use the memory... */
                    printf("memory allocated\n");
                    farfree(far_ptr);   /* ...then free the memory */
                    printf("memory freed");
               }
           }


See Also: farcoreleft() farmalloc() farmalloc() farrealloc()

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