× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I've groused about the 16meg space limit on the system, thinking that
it cripples things like XML string processing. I knew about teraspace,
but never tried it, assuming that the system would require the entire
activation group to be teraspace space enabled or something. Was I
ever wrong!

RPG cant allocate teraspace directly, but it can copy to and from
teraspace memory. Most important, RPG can set its own pointers
anywhere within a 16meg+ sized teraspace allocation. All you need is
an ILE C module that contains a procedure that runs malloc to alloc
the space and another that runs free to free the teraspace. When the
C module is compiled simply compile with the following parms:
CRTCMOD MODULE(&MODLIB/&MODNAME) +
SRCFILE(&SRCFLIB/&SRCFNAME) +
SRCMBR(&SRCMBR) DBGVIEW(&DBGVIEW) +
TERASPACE(*YES *TSIFC) STGMDL(*SNGLVL) +
DTAMDL(*P128)

here are the C procs:
/* -------------------- tera_Alloc -------------------------- */
extern char*
tera_Alloc( int InSx )
{
char* pData ;

pData = malloc( InSx ) ;
return pData ;
}

/* -------------------- tera_Free ------------------------- */
extern void
tera_Free( void* pInData )
{
free( pInData ) ;
}

the RPG code requires no special create parameters. Here is the RPG
code that uses teraspace:

d pAlloc s *
d pData s *
d data s 80a based(pData)
d sx s 10i 0
d ox s 10i 0
/free
sx = 20000000 ;
pAlloc = tera_Alloc( sx ) ;
ox = sx - 1000000 ;
pData = pAlloc + ox ;
data = 'abc' ;
tera_Free( pAlloc ) ;

-Steve

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.