GDSX (Extended General Device Support) Manual

Service Routines
Extended General Device Support (GDSX) Manual529931-001
8-32
GETEXTPOOL
Considerations
No mechanism for queuing of allocation requests or timeout is provided. For
private storage such a facility has no purpose because each task has its own
individual pool.
A call to ^CHECKPOINT(2) checkpoints all local and extended memory pools
acquired by the calling task.
If poolcheck^flag of the DEBUGFLAGS configuration parameter is set, each time a
task is dispatched, TSCODE checks the buffer pool, message pool, extended
buffer pool, and extended message pool for corruption. If corruption is detected,
GDSX stops with abend error 230 or abend error 231. This pool checking is in
addition to that always done when the GETLOCALPOOL and GETEXTPOOL
procedures are called.
The poolcheck^flag can be set when debugging a program and turned off during
production to allow GDSX to run more efficiently.
Examples
1. This example allocates 20 words in the extended buffer pool and deallocates the
space when it is no longer needed with PUTEXTPOOL:
INT .EXT buf; !Pointer for extended buffer pool.
INT size := 20; !Length in words of extended pool
!area to acquire.
INT(32) holdaddr; !Hold extended buffer address (optional)
.
@buf := GETEXTPOOL (10, size);
holdaddr := @buf;
.
CALL PUTEXTPOOL (10, @buf);
or
CALL PUTEXTPOOL (10, holdaddr);
2. This example allocates 100 words in the shared extended pool and deallocates the
space when it is no longer needed with PUTEXTPOOL:
> PARAM TASKPOOLSIZE 2000 !comment 2000 words
> PARAM POOLSIZE 200 !comment 200 words
> RUN GDSC /NAME $GDSX, NOWAIT/
BLOCK USER^PRIVATE;
INT .EXT GLOBAL^SHARED^PTR := 0D;
INT .EXT TASK^SHARED^PTR;
.
END BLOCK;
PROC USER^START;
INT WDS;
! Pointer initialized @ first call to USER^START
IF @GLOBAL^SHARED^PTR = 0D THEN
BEGIN