> Sure - it could assign one. It wouldn't have to be unique; just
access-exception correct.

And then the OP would have cleared that "dummy" storage area passed back
from OBTAIN and wondered how _that_ happened. 

I don't see how IBM solves it without creating a nightmare for some number
of programs that do this.

Here's a solution for all those who want it to ABEND: follow every GETMAIN
or OBTAIN in your code with MVI 0(R1),0 and you will S0C4 if you asked for
zero bytes.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Tony Harminc
Sent: Wednesday, February 12, 2014 3:39 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Storage Obtain .....

On 12 February 2014 18:22, Gerhard Postpischil <gerha...@charter.net> wrote:
> On 2/12/2014 6:06 PM, Tony Harminc wrote:
>>
>> I object far more to returning an address of 0 than to accepting a 
>> length of 0 on the request. To be sure, you are allowed to store no 
>> more than 0 bytes in your obtained area, so the 0 address sounds 
>> reasonable, but some instructions are allowed by the architecture to 
>> recognize access exceptions in the case where no data is stored, e.g.
>> STCM with a zero mask.

> The way I get and free storage, I'd be happier with an abend (R form) 
> or non-zero return code.

Sure, but as said, that's not going to happen for reasons of compatibility.

> I generally save the length, and then do a FREEMAIN (or STORAGE 
> RELEASE) using the saved length. If the GETMAIN/OBTAIN was accepted, 
> freeing zero length is an instant disaster.

You can't free 0 bytes at address 0? Now that is an inconsistency. Ah
- the subpool thing on FREEMAIN. Is that also true for STORAGE RELEASE?

>> So to be consistent, a non-zero address with appropriate access setup 
>> (primarily key) should probably be returned.

> Consistent with what? It can't return an address because one wasn't
assigned.

Sure - it could assign one. It wouldn't have to be unique; just
access-exception correct.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to