From -7866028848456646517
X-Google-Thread: f78e5,a10702d4a7db0a94
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news2.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: usenet@aristeia.com (Scott Meyers)
Newsgroups: comp.std.c++
Subject: Re: Why no size_t to ::operator delete?
Date: Sat, 23 Dec 2006 21:10:57 GMT
Organization: Posted via Supernews, http://www.supernews.com
Lines: 31
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <12or0p6oph82af5@corp.supernews.com>
References: <12omt8jit7rl379@corp.supernews.com> <Fe2dna0ZAa0PdxHYnZ2dnUVZ_rylnZ2d@giganews.com>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1166908263 6712 158.152.254.254 (23 Dec 2006 21:11:03 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 23 Dec 2006 21:11:03 +0000 (UTC)
X-Original-To: std-c++@mailman.ucar.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.0
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.csse.unimelb.edu.au (8.13.8+Sun/8.13.8/Submit) id kBNLAvWH009147;
	Sun, 24 Dec 2006 08:10:57 +1100 (EST)
X-Delivered-To: std-c++@mailman.ucar.edu
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news2.google.com comp.std.c++:5148

P.J. Plauger wrote:
> It's another thing to get wrong.

I don't see how it's any more error-prone than the class-specific 
version of operator delete that takes a size.

 >  And it's a false economy not to want to
> "spend the memory" to pack it with the allocated storage. You're storing
> the information *somewhere*, in some form.

I don't believe this is the case;  see my reply to Lucas Galfaso's post.

 > Okay, maybe a thousand items
> can all have the same compile-time constant size, which occupies just
> a field in one instruction. If that's an important part of your size
> budget, then you should be maintaining a LIFO array as a single block,

The situation in question is strict LIFO allocation, but not all objects 
are of the same size.  Hence the need for the deallocator to know how 
big each allocation is.  Storing the size of each object is clearly 
possible, but my contention is that it is not necessary, per my earlier 
posts.

Scott

---
[ 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.comeaucomputing.com/csc/faq.html                      ]



