28 lines
676 B
C
28 lines
676 B
C
|
#include <stdio.h>
|
||
|
#include <dos.h>
|
||
|
|
||
|
void main( void )
|
||
|
{
|
||
|
#if defined(__NT__) || \
|
||
|
( defined(__OS2__) && \
|
||
|
(defined(__386__) || defined(__PPC__)) )
|
||
|
void *segment;
|
||
|
#else
|
||
|
unsigned segment;
|
||
|
#endif
|
||
|
|
||
|
/* Try to allocate 100 paragraphs, then free them */
|
||
|
if( _dos_allocmem( 100, &segment ) != 0 ) {
|
||
|
printf( "_dos_allocmem failed\n" );
|
||
|
printf( "Only %u paragraphs available\n",
|
||
|
segment );
|
||
|
} else {
|
||
|
printf( "_dos_allocmem succeeded\n" );
|
||
|
if( _dos_freemem( segment ) != 0 ) {
|
||
|
printf( "_dos_freemem failed\n" );
|
||
|
} else {
|
||
|
printf( "_dos_freemem succeeded\n" );
|
||
|
}
|
||
|
}
|
||
|
}
|