This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/halloc.c

19 lines
359 B
C
Raw Normal View History

#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 */
}
}