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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c19e8df8a75221d0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 01 Sep 2009 11:55:22 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Q: Line_IO References: <4a9b045a$0$31875$9b4e6d93@newsspool3.arcor-online.net> <1a4usf20z4mxa.1vct95fmrcs6h.dlg@40tude.net> <4a9c6320$0$31347$9b4e6d93@newsspool4.arcor-online.net> <56e70160-3e24-4bd0-be49-99999c191522@e34g2000vbm.googlegroups.com> In-Reply-To: <56e70160-3e24-4bd0-be49-99999c191522@e34g2000vbm.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a9cef8a$0$30222$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 01 Sep 2009 11:55:22 CEST NNTP-Posting-Host: 1b69ffc1.newsspool1.arcor-online.net X-Trace: DXC=1V798R[2njS<<0iRN7DLEQic==]BZ:af^4Fo<]lROoRQ^YC2XCjHcbYQmlE46GMfJY;9OJDO8_SKVNSZ1n^B98iZCP4gQSI89n^ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8094 Date: 2009-09-01T11:55:22+02:00 List-Id: Ludovic Brenta schrieb: > Georg Bauhaus wrote on comp.lang.ada: >> BUFSIZ: constant := 8_192; > [...] >> SL : constant Natural := Separator_Sequence'Length; >> subtype Extended_Buffer_Index is Positive range 1 .. BUFSIZ + SL; > > Since BUFSIZ is obviously chosen as an integral number of hardware > memory pages, the extended_buffer uses two pages plus two bytes. How > about allocating a buffer of BUFSIZ bytes and using only BUFSIZ-SL for > the string and the remaining SL bytes for the terminator? I had made the buffer have BUFSIZ + Separator_Sequence'Length elements because Stream_IO.Read would then have BUFSIZ bytes into which to store its data. I was only guessing that this would matter; indeed, it is somewhat faster than using BUFSIZ = 128. But growing beyond 8192 did not have an effect. I'll try others. Another thing: The names look bit bulky, at least from a "molecular source pattern" matching point of view. But I can't produce better short and meaningful names that are still Ada. Is it enough to add a few empty lines? Ideas welcome.