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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4fbd260da735f6f4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!news.tiscali.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Alternative Index implementation? (Was: Reading and writing a big file in Ada (GNAT) on Windows XP) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <0hj5339mjmond132qhbn2o01unurs61lbj@4ax.com> <1178091967.392381.282510@o5g2000hsb.googlegroups.com> Date: Fri, 4 May 2007 09:41:58 +0200 Message-ID: <5dv3wh6scrh1.2986pbvdw8y2$.dlg@40tude.net> NNTP-Posting-Date: 04 May 2007 09:41:57 CEST NNTP-Posting-Host: e3bd1b6d.newsspool3.arcor-online.net X-Trace: DXC=eT752JZ44?NI7\_^6>c20JMcF=Q^Z^V3H4Fo<]lROoRAFl8W>\BH3YB?P2N8WQ]`>ODNcfSJ;bb[EFCTGGVUmh?DLK[5LiR>kgBEO:gIPQEG8@ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15499 Date: 2007-05-04T09:41:57+02:00 List-Id: On Fri, 04 May 2007 08:53:59 +0200, Jacob Sparre Andersen wrote: > My demonstration of how you can make a fast implementation of the Unix > command "tail" with POSIX.Memory_Mapping was not very successful, and > I suspect that the sinner may be Index. [...] > for Lines in 1 .. 10 loop > Last := Index (Source => Text (Text'First .. Last - 1), Did you check if GNAT did not copy the string slice before calling to Index? > Pattern => (1 => Latin_1.LF), > Going => Backward); > exit when Last = 0; > end loop; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de