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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,15e41875b75969fc,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!w5g2000hsg.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Dynamically reallocated buffer Date: Thu, 31 May 2007 23:33:46 -0700 Organization: http://groups.google.com Message-ID: <1180679626.254857.59070@w5g2000hsg.googlegroups.com> NNTP-Posting-Host: 137.138.37.241 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1180679626 8083 127.0.0.1 (1 Jun 2007 06:33:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 1 Jun 2007 06:33:46 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070228 Red Hat/1.5.0.10-0.1.slc3 Firefox/1.5.0.10,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: w5g2000hsg.googlegroups.com; posting-host=137.138.37.241; posting-account=Ch8E9Q0AAAA7lJxCsphg7hBNIsMsP4AE Xref: g2news1.google.com comp.lang.ada:16011 Date: 2007-05-31T23:33:46-07:00 List-Id: I need a dynamically reallocated buffer of bytes, which I can extend at run-time by appending new fragments to the whole buffer. The purpose of the buffer is to pass it later to the subprogram that writes it "en bloc" to some external device. For those of you who know C++ I need something like: vector buffer; // fill the buffer with push_back or insert at end // ... write_to_device(&buffer[0], buffer.size()); The problem is that Ada.Containers.Vectors does not provide the necessary guarantees to be any useful in this context. What are your suggestions? -- Maciej Sobczak http://www.msobczak.com/