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,147f221051e5a63d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!x41g2000hsb.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: memory management in Ada: tedious without GC? Date: Sun, 18 May 2008 07:10:55 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9dc4760f-66a2-4f02-b3c3-8183d6ffdf8a@x41g2000hsb.googlegroups.com> References: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> <482E8A9D.5040401@obry.net> <8640a12f-da99-435f-8eb6-372e175cd5b9@z72g2000hsb.googlegroups.com> <482F19CE.7060306@obry.net> <87d4nkzhtn.fsf@willow.rfc1149.net> <2545491.n7xu0MFufK@linux1.krischik.com> <143d9t4zvr3jh$.1iwejgp9vpckx$.dlg@40tude.net> NNTP-Posting-Host: 85.3.99.233 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1211119855 30257 127.0.0.1 (18 May 2008 14:10:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 18 May 2008 14:10:55 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x41g2000hsb.googlegroups.com; posting-host=85.3.99.233; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:202 Date: 2008-05-18T07:10:55-07:00 List-Id: On 18 Maj, 11:31, "Dmitry A. Kazakov" wrote: > The problem with C++ and vector is not that vector is not built-in. It is > that vector cannot have a treatment fully equal to a built-in type: > > 1. Its body cannot be allocated on the stack. What is "body"? The vector can be allocated on the stack and be formally an object with automatic storage duration (there is no "stack" in C++, BTW). It can have some of its state elsewhere, but this is not your concern - the buzzword for this is "encapsulation". Note also that there exists what is called a "short vector optimization" (SVO), more often used for strings. > 2. It is not a proper type (requires parametrization) Is it wrong? > 3. Optimization. I have doubts that small vectors could be passed by value, > loops over them unrolled, values cached in registers, that static bounds > checking could be enforced at compile time and skipped at run-time etc. All of these can be done. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com