comp.lang.ada
 help / color / mirror / Atom feed
From: Jeff Creem <jcreem@yahoo.com>
Subject: Re: Follow up 2: raised STORAGE_ERROR : helper.adb:386 object too large
Date: Wed, 10 Aug 2005 00:56:11 -0400
Date: 2005-08-10T00:56:11-04:00	[thread overview]
Message-ID: <BYmdnVeI35x0FWTfRVn-pw@comcast.com> (raw)
In-Reply-To: <4486c49961e0e8ce8904b267fcc860b5@localhost.talkaboutprogramming.com>

Adaddict wrote:
> Ok, I changed the way of declaring the large variable, and now I'm getting
> a different but nicer looking error: raised STORAGE_ERROR : helper.adb:386
> object too large
> 
> The variable is a string (1..n), where n it's the number of bytes that are
> going to be read from certain region. The region size can be of some MB, so
> I would be easy for me if I could use a variable from this size. How could
> I do it? And if I can't do it what alternative would you recomend me?
> 
> Thanks a lot to everyone for your replies and help.
> 
> Regards.
> 

It is hard to tell without looking at the context what the best solution 
is. If the string is fairly local then an access type can probably be 
used without worrying too much about creating leak by doing something 
based on....

type Access_String is access String;
procedure Free is new Unchecked_Deallocation(String, Access_String);

..
..
.. code that is getting N

begin
   Region_Data := new String(1 .. N);
   Fill_In_Data_Into_Region_Data

   Call_Existing_Code_THat_Wants_String(Region_Data.all);

   Free(Region_Data);

exceptioon
   when others =>
      Free(Region_Data);
      raise;
end;



  reply	other threads:[~2005-08-10  4:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-05  0:55 STORAGE_ERROR : EXCEPTION_STACK_OVERFLOW Adaddict
2005-08-05  1:21 ` Adaddict
2005-08-06 11:21 ` How to set the stack size on GNAT (Follow-up) Adaddict
2005-08-07 12:33   ` Please, help me Adaddict
2005-08-07 14:11     ` Jeff Creem
2005-08-07 14:51       ` Increasing stack size (was: Please, help me.) Larry Kilgallen
2005-08-07 15:16       ` Please, help me Ludovic Brenta
2005-08-07 15:31   ` How to set the stack size on GNAT (Follow-up) John B. Matthews
2005-08-07 16:15   ` (Follow-up) Adaddict
2005-08-07 17:59     ` (Follow-up) Jeffrey Carter
2005-08-07 20:49       ` (Follow-up) Adaddict
2005-08-09 22:05 ` Follow up 2: raised STORAGE_ERROR : helper.adb:386 object too large Adaddict
2005-08-10  4:56   ` Jeff Creem [this message]
2005-08-10 17:44     ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox