Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <malloc.h>
    size_t _msize( void *buffer );
    size_t _bmsize( __segment seg, void __based(void) *buffer );
    size_t _fmsize( void __far *buffer );
    size_t _nmsize( void __near *buffer );

Description:
    The  _msize functions return the size of the memory block pointed to by
    buffer that was allocated by a call to the appropriate version of the
     calloc,  malloc, or  realloc functions.

    You must use the correct  _msize function as listed below depending on
    which heap the memory block belongs to.

    _msize
        Depends on data model of the program

    _bmsize
        Based heap specified by seg value

    _fmsize
        Far heap (outside the default data segment)

    _nmsize
        Near heap (inside the default data segment)

    In small data models (small and medium memory models),  _msize maps to
     _nmsize.  In large data models (compact, large and huge memory models),
     _msize maps to  _fmsize.

Returns:
    The  _msize functions return the size of the memory block pointed to by
    buffer.

See Also:
    calloc Functions Functions, _expand Functions Functions, free Functions Functions, halloc, hfree,
    malloc Functions Functions, realloc Functions Functions, sbrk

Example:
    #include <stdio.h>
    #include <malloc.h>

    void main()
      {
        void *buffer;

        buffer = malloc( 999 );
        printf( "Size of block is %u bytes\n",
                    _msize( buffer ) );
      }

    produces the following:

    Size of block is 1000 bytes

Classification:
    WATCOM

Systems:
     _msize - All

    _bmsize - DOS/16, Win/16, QNX/16, OS/2 1.x(all)
    _fmsize - DOS/16, Win/16, QNX/16, OS/2 1.x(all)
    _nmsize - DOS, Win, QNX, OS/2 1.x, OS/2 1.x(MT), OS/2 2.x, NT

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