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

 #include   <malloc.h>                   Required for declarations only

 unsigned int  _freect(size);
 unsigned int  size;                     Item size in bytes

    _freect() returns the approximate number of times malloc(), calloc(),
    realloc(), or _nmalloc() can be called to allocate 'size' bytes in
    the default data segment.

    Returns:    Approximate number of malloc(size) calls possible for
                default data segments.

      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.

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

    The following statements report the approximate number of times
    malloc() can be called to allocate an array of 10 long integers.

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

            main()
            {
              printf("approximately %u arrays can be separately allocated\n",
                       _freect(10 * sizeof(long)));
            }

See Also: malloc() _memavl() _msize() stackavail()

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