ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: Re: Proven ptr<>
by Philippe A. Bouchard other posts by this author
Aug 12 2002 5:52AM messages near this date
Re: [boost] Re: Proven ptr<> | [boost] Re: Proven ptr<>
>  >Uhh...  pool is an accelerated memory allocator, but still is a memory
>  >allocator.  If we would use the standard malloc(), reconstruction of
>  >containers would be like allocating a separate reference count.  Also
get()
>  >is not that slow: 1 more second for 1000 sorts of a 10000 element
container.
> 
>  I'm not sure of the tradeoffs, but you have to allocate a
>  reference count anyway, no?  And you are paying an extra
>  cost in space of about N*(N/2) offsets for a system with
>  N ptr<> types, yes?

For N pointee allocations:
extra size = 2 x sizeof(int) x N.

The reference count is allocated at the same time the pointed object is and
takes 2 extra integers in size.  Yes I take 1 integer for the type
identification but don't we forget that the system memory map is smaller
(thus faster).



Philippe A. Bouchard





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Peter Dimov
Philippe A. Bouchard
David B. Held
David Abrahams
Philippe A. Bouchard
Philippe A. Bouchard
Greg Colvin
David B. Held
Philippe A. Bouchard
David Abrahams
David Abrahams
Philippe A. Bouchard
David Abrahams
Philippe A. Bouchard
Philippe A. Bouchard
Philippe A. Bouchard
Greg Colvin
Philippe A. Bouchard
Greg Colvin
Greg Colvin

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved