This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Re: How does std::deque work currently?


On Mon, Jan 26, 2004 at 10:17:01AM +0530, Dhruv Matani wrote:
> On Mon, 2004-01-26 at 08:24, Matt Austern wrote:
> > On Jan 14, 2004, at 3:29 AM, Dhruv Matani wrote:
> > >
> > > Now, I was wondering if it would be feasible to make the map point to
> > > only 1 element instead of a collection of elements?
> > 
> > I'm not 100% sure what you're asking.  Are you asking why we have
> > a block that's large enough to hold N elements instead of one that's
> > only large enough to hold one element?
> 
> Yes. Exactly. What's the reasoning that went behind that decision?

Probably just aiming to reduce memory fragmentation.  As you noticed,
the number of elements is inversely proportional to sizeof T, until at
(IIRC) 512+ bytes each block /is/ holding only one element.

-- 
America may be unique in being a country which has leapt
from barbarism to decadence without touching civilization.
  - John O'Hara


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]