Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: C++ Memory ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 31 of 41 Topic 9525 of 9828
Post > Topic >>

Re: C++ Memory Management Innovation: GC Allocator

by xushiwei <xushiweizh@[EMAIL PROTECTED] > Apr 28, 2008 at 11:27 PM

{ Please note that top-posting is discouraged in this group. -mod }

These days I spent a lot of time researching Boehm GC, Hoard/
HeapLayers/reaps, streamflow, dlmalloc, etc.

Yes, "GC Allocator" is a region allocator. It's no innovation. But:

This (ScopeAlloc) is not a normal region allocator. All ScopeAlloc
instances in the same thread share their freelist. This makes you can
define a lot of ScopeAlloc instances (depends your needs). You even
can define a ScopeAlloc instance for each allocation.

Most allocators optimize allocating a lot of objects. If ONE allocator
instance only allocates ONE object instance, they become slower than a
normal new/delete allocation.

Since you can define a lot of ScopeAlloc instances as you need, So It
doesn't waste too much memory as normal region allocators.

ScopeAlloc is useful. For example:

* When you are writing an io component (eg. a word file writer:
http://xu****wei.com/the-fastest-word-file-writer).
* When you are writing a search engine.
* When you are writing a layout render engine.
* When you are responding a http request.

And I don't think it is all of C++ memory management. if you implement
algorithms that are related to t (that is, how many time of the
algorithm spent is unsure.), ScopeAlloc doesn't fit you directly.

Last, I think that we need a standard region allocator. Yes, maybe it
is have limits. But just like unique_ptr (auto_ptr), scoped_ptr, they
are useful but not a general solution.


On 4月29日, 上午5时58分, Yongwei Wu <wuyong...@[EMAIL PROTECTED]
> wrote:
> On Apr 23, 5:22 am, xu****wei <xu****we...@[EMAIL PROTECTED]
> wrote:
>
> > In fact, "GC Allocator" is NOT "GC".
>
> > "GC Allocator" focus:
>
> > 1. It is a better "Smart Pointer".
> > 2. Deleting objects manually is no need if you use "GC Allocator".
>
> I found it difficult to justify your statement.  How do you deallocate
> objects, really?  You did not explain well in the PDF, and a glance at
> the code indicated that you simply do *not* deallocate objects in the
> middle of a function.  If I did not read wrong, your work is not
> suitable in most real-world cases that require a program to run for
> more than a short while.
>
> > 3. Use non-static allocator instances to allocate memory instead of
> > global new/delete procedures. Then multithreads locks are OPTIONAL and
> > you can use explicit locks if you need.
>
> > You can consider "GC Allocator" as a "Smart Pointer" or a "Allocator",
> > but It isn't a "GC".
>
> I do not think your allocators are GC at all.  And it should not
> called in the current name.
>
> Best regards,
>
> Yongwei


-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 41 Posts in Topic:
[Proposal for ISO C/C++] C++ Memory Management Innovation: GC A
xushiwei <xushiweizh@[  2008-04-21 12:13:18 
Re: [Proposal for ISO C/C++] C++ Memory Management Innovation: G
"Chris Thomasson&quo  2008-04-21 15:39:15 
Re: [Proposal for ISO C/C++] C++ Memory Management Innovation: G
"Chris Thomasson&quo  2008-04-21 16:13:16 
Re: [Proposal for ISO C/C++] C++ Memory Management Innovation: G
Alberto Ganesh Barbati &l  2008-04-21 20:43:17 
Re: C++ Memory Management Innovation: GC Allocator
marlow.andrew@[EMAIL PROT  2008-04-21 20:43:18 
Re: C++ Memory Management Innovation: GC Allocator
Lance Diduck <lancedid  2008-04-21 20:43:17 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 00:08:55 
Re: [Proposal for ISO C/C++] C++ Memory Management Innovation: G
"Chris Thomasson&quo  2008-04-22 10:52:14 
Re: C++ Memory Management Innovation: GC Allocator
Lance Diduck <lancedid  2008-04-22 11:17:48 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 11:17:25 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 11:13:27 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 15:19:26 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 15:19:18 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 15:22:50 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 15:43:17 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 22:26:21 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 22:25:42 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 22:32:36 
Re: C++ Memory Management Innovation: GC Allocator
Francis Glassborow <fr  2008-04-23 14:13:19 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-23 14:43:18 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-24 01:43:35 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-25 03:42:49 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-25 10:47:43 
Re: C++ Memory Management Innovation: GC Allocator
"Stephen Howe"   2008-04-25 10:48:18 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-25 10:47:13 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-25 10:45:25 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-25 10:44:50 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-25 16:15:02 
Re: C++ Memory Management Innovation: GC Allocator
Yongwei Wu <wuyongwei@  2008-04-28 15:58:48 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-28 23:26:31 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-28 23:27:55 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-29 17:43:31 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-30 04:13:27 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-30 04:13:33 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-30 17:03:54 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-30 21:55:29 
Re: C++ Memory Management Innovation: GC Allocator
Michael Kilburn <crusa  2008-05-06 08:22:59 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-05-06 08:20:19 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-05-07 00:31:29 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-05-07 11:03:52 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-05-08 03:28:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 15:50:15 CDT 2008.