From -5502940183217776577
X-Google-Thread: f78e5,27c2a088314ec0a9
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news2.google.com!proxad.net!news2.telebyte.nl!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: tom_usenet@hotmail.com (Tom Widmer)
Newsgroups: comp.std.c++
Subject: Re: should std::vector<> exponential growth rate be followed	strictly in times of low availabe memory.
Date: Thu,  4 Nov 2004 22:29:30 GMT
Organization: [posted via Easynet UK]
Lines: 25
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <4fvjo0t07isfber4rblifh56jmiq2glrnj@4ax.com>
References: <pan.2004.10.21.16.46.37.514542@gmx.net>	<417E434E.5000209@bubblescope.net> <pan.2004.10.27.02.38.48.35649@gmx.net>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1099607977 26337 158.152.254.254 (4 Nov 2004 22:39:37 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 4 Nov 2004 22:39:37 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Virus-Scanned: by amavisd-new at cs.mu.OZ.AU
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id iA4MTUa1023410;
	Fri, 5 Nov 2004 09:29:30 +1100 (EST)
X-Delivered-To: std-c++@ucar.edu
X-Spamscanner: mailbox6.ucsd.edu  (v1.5 Aug 25 2004 09:28:35, 1.1/5.0 3.0.0)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Greylist: Delayed for 01:13:00 by milter-greylist-1.4 (mailbox6.ucsd.edu [132.239.1.58]); Thu, 04 Nov 2004 03:17:23 -0800 (PST)
X-Newsreader: Forte Free Agent 2.0/32.652
X-Newsgroups: comp.std.c++
X-MailScanner: PASSED (v1.2.8 65166 iA4BHLFM075051 mailbox6.ucsd.edu)
Xref: g2news1.google.com comp.std.c++:3283

On Wed, 27 Oct 2004 03:43:46 GMT, dhruvbird@gmx.net ("Dhruv Matani")
wrote:

>Yes, but it would obviously be a nonsense implementation as you have
>mentioned. I'm looking more at making it allowable by the standard in
>such low memory situations to deviate from the exponential growth
>policy.

And the standard already allows that, since it doesn't specify
"exponential growth", but rather amortized constant time push_back.

However, I don't think a 1GB+ std::vector is a very good idea in any
case. If you use malloc, then you get access to realloc, or you should
perhaps be using a custom allocator, or redesigning your algorithm,
perhaps to allow a segmented container of some kind, or to use less
RAM.

Tom

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



