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>
    void __huge *halloc( long int numb, size_t size );

Description:
    The halloc function allocates space for an array of numb objects of size
    bytes each and initializes each object to 0.  When the size of the array
    is greater than 64K bytes, then the size of an array element must be a
    power of 2 since an object could straddle a segment boundary.

Returns:
    The halloc function returns a far pointer (of type void huge *) to the
    start of the allocated memory.  The NULL value is returned if there is
    insufficient memory available.  The NULL value is also returned if the
    size of the array is greater than 64K bytes and the size of an array
    element is not a power of 2.

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

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

    void main()
      {
        long int __huge *big_buffer;

        big_buffer = (long int __huge *)
                      halloc( 1024L, sizeof(long) );
        if( big_buffer == NULL ) {
          printf( "Unable to allocate memory\n" );
        } else {

          /* rest of code goes here */

          hfree( big_buffer );  /* deallocate */
        }
      }

Classification:
    WATCOM

Systems:
    DOS/16, Win/16, QNX/16, OS/2 1.x(all)

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