From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,55a8252137b5ef97 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Efficiently setting up large quantities of constant data Date: Fri, 17 Dec 2004 15:16:02 +0100 Message-ID: <41C2EA22.2080107@mailinator.com> References: <2508656.W3VlADmtU1@jellix.jlfencey.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net qYIR5W+XJ5heXHKFe8AeRQeZc2MfmqpLazJwi6A61MVUz4YPo= User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:7036 Date: 2004-12-17T15:16:02+01:00 List-Id: Dr. Adrian Wrigley wrote: > OK I have just tried this. > > I have a plain text file "NigeriaScam4.txt", which I turn into > an object file "nigeria.o", and link in. (Source below) You should check AWS resources. I think it can be more "ada-ish". It seems perfectly suited for this. The only problem I've encountered is for very large files (over 4MB) which require huge quantities of memory to be compiled with Gnat. However, the latest AWS version supports compressed resources which may ease this problem a bit. > > I encountered one or two problems: > > I can't access the "..._size" value. This is an absolute value > in the object file, not the location where the value is stored. > If I try to Import the size, the program crashes at runtime, > because the size is incorrectly interpreted as the location of > the variable storing the size. > > The code works, but seems a bit messy. Calculating the size > is a nuisance, and I can't "import" the Message (local type > is not constant). > Aside from these issues, the code works. The program > outputs the contents of the text file as > built into the executable. > > Any ideas for: > > 1) Importing the value of the ..._size symbol > 2) Making the contents constant > 3) Tidying it up a bit > > note that writing into the Message is possible, but probably > shouldn't be. (is there an option to make the data read-only?) > > Of course, the Message could be copied into another value > which was constant, but that would be wasteful. Or an > access to constant value could be used. > > Thanks