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>_memavl() return size of memory available</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _memavl()               Return Size of Memory Available

 #include   <malloc.h>                   Required for declarations only

 size_t   _memavl(void);

    _memavl() returns the approximate number of bytes that can be
    allocated in the default data segment by malloc(), calloc(),
    realloc() (using the small and medium memory models), and _nmalloc()
    (in all memory models).

    Returns:    Approximate number of bytes available in the default data
                segment.

      Notes:    Compact, large, and huge memory model programs may have
                additional space outside the default segment.

                _fmalloc() may be able to allocate additional space
                outside the default data segment.

 Portability:   Applies to MS DOS only.

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

    The following statement reports the approximate number of bytes
    available in the default data segment.

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

           main()
           {
               printf("approximately %u bytes available\n",
                       _memavl());
           }


See Also: malloc() _freect() stackavail()

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