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>heapfillfree() fill free heap block with a constant value</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 heapfillfree()          Fill Free Heap Block With a Constant Value

 #include   <alloc.h>

 int heapfillfree(fillval);
 unsigned int fillval;          Fill value to use.

        This function fills a free block on the heap with a constant
        value, fillval. The possible return values are:

                _HEAPOK         Heap is alright.
                _HEAPEMPTY      Heap is empty.
                _HEAPCORRUPT    Heap has been corrupted.

       Returns:     Greater than zero for success; negative otherwise.

   -------------------------------- Example ---------------------------------
        This example fills a free block on the heap with the value 3.

 #include <stdio.h>
 #include <alloc.h>
 #include <mem.h>

 int main(void)

    char *my_block;

       my_block = malloc(1000);

       free (my_block);

       if( heapfillfree(3) < 0)
       printf( "Heap problems.\n" );
    return 0;


See Also: farheapfillfree()

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