Rich Diedrich just wrote to me about this and pointed out "The limit
for teraspace allocation is just under 2GB and the (CGIDEV2) functions
used to allocate the space use unsigned (4 byte) integers.  So your
code was actually correct."

CGIDEV2 uses _C_TS_malloc and related funtions to allocate and manage
dynamic teraspace storage.

The C C++ Run-time Library Functions manual says: "The maximum amount
of Teraspace storage that can be allocated by each call to
_C_TS_malloc() is 2GB - 224, or 2147483424 bytes." 

The CGIDEV2 variables used to manage allocated storage are unsigned
(4-byte) integers (10u 0) with a maximum value of 2**32 - 1 or 
4294967295, which is adequate for the maximum allocation.

If CGIDEV2 had used _C_TS_malloc64 and its related functions, which
permit allocations larger than 2147483424 bytes, CGIDEV2's variables
for managing the allocated storage would have had to be unsigned
(8-byte) RPG IV integer (20u 0) variables with a maximum value of
2**64 - 1 or 18446744073709551615.

It seems that 2147483424 of dynamic storage should be more than enough
to hold any HTTP response.

Mel Rothman
Mel Rothman, Inc.


--- In [email protected], Mel Rothman <[EMAIL PROTECTED]> wrote:
>
> Scott is, of course, right about this.
> 
> I should have changed OutBufAlloc and OutBufUsed to "20U 0".
> 
> Since Giovanni and I no longer control CGIDEV2, I'll send a copy of
this 
> message to IBM's Rich Diedrich for his consideration.
> 
> I agree with Scott that it's unlikely anyone would ever need to
exceed 4 GB.
> 
> Mel Rothman
> Mel Rothman, Inc.
> 
> Scott Klement wrote:
> 
> >
> > > "Assuming you are using CGIDEV2 Version 2004-09-02 17:40:18 or
later,
> > > CGIDEV2's HTML output buffer can grow up to about 2 terabytes.
> >
> > I agree that the OP's problem is due to having an older version.  
> > However,
> > the output buffer can't be 2 TB.
> >
> > The reason is because you're using a variable called "OutBufAlloc" to 
> > keep
> > track of how big the output buffer is, and this variable is defined as
> > "10U 0".   Since the largest number that a 10U field can store is
> > 4,294,967,295, the program would crash with a "Receiver Value too 
> > Small to
> > Hold Result" if you tried to exceed 4gb.
> >
> > However, I can't imagine anyone ever needing to exceed 4gb.
> >
>





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Easy400Group/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to