Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 819 -
------------------------------------------------------------------------------
17. Deallocate memory block <Main,Alarm,Comm>
------------------------------------------------------------------------------
[Name]
os_disp_mem
[Syntax]
#include <oscall.h>
unsigned short os_disp_mem( unsigned int sel ) ;
[Argument]
sel Segment selector which points the memory block to
free.
[Return]
0 Successful.
0x015F,
0x0160,
0x0161 Invalid segment selector.
[Description]
Deallocates the memory block which was allocated by "os_new_mem"
function.
Specify the segment selector that "os_new_mem" function returned
in "sel".
[Example]
The following program frees the allocated memory block.
#include <oscall.h>
#include <stdio.h>
void example( unsigned int sel )
{
unsigned int ret ;
ret = os_disp_mem( sel ) ;
if ( !ret ) {
printf( "Memory block has been freed.\n" ) ;
return( sel ) ;
}
else {
printf( "Invalid selector.\n" ) ;
return( 0 ) ;
}
}