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/_freect.c

20 lines
486 B
C

#include <stdio.h>
#include <malloc.h>
void main()
{
int i;
printf( "Can allocate %u longs before _nheapgrow\n",
_freect( sizeof(long) ) );
_nheapgrow();
printf( "Can allocate %u longs after _nheapgrow\n",
_freect( sizeof(long) ) );
for( i = 1; i < 1000; i++ ) {
_nmalloc( sizeof(long) );
}
printf( "After allocating 1000 longs:\n" );
printf( "Can still allocate %u longs\n",
_freect( sizeof(long) ) );
}