gtpc2m62 | C/C++ Language Support User's Guide |
This function releases storage from the system heap, and returns the 4-KB frames to the pool of available frames.
Format
#include <sysapi.h> int rsysc(void *address, int frames, char *token);
Normal Return
RSYSC_OK indicates that the storage is released successfully.
Error Return
If the function was passed an incorrect address, number of frames, or token, error code RSYSC_ERROR is returned and no storage is released.
Programming Considerations
Examples
The following example allocates and releases 12 KB of system heap storage.
#include <sysapi.h> #include <stdio.h>
·
·
·
{ /******************************************************************/ /* Allocate 12 KB of storage for a table used by many different */ /* ECBs. */ /******************************************************************/ int frames, rc; char * token = "TABLE40 "; struct table { char *name; int code; } *tbl_ptr; frames = 3; tbl_ptr = gsysc(frames, token); if (tbl_ptr == 0) { serrc_op(SERRC_EXIT, 0x1111, "Error allocating table.", NULL); }
·
·
·
rc = rsysc((void *)tbl_ptr, frames, token); if (rc == RSYSC_ERROR) { serrc_op(SERRC_EXIT, 0x2222, "Error releasing storage.", NULL); } }
Related Information