[prog] C++ object creation

Jimen Ching jching at flex.com
Wed May 28 09:36:35 EST 2003


On Wed, 28 May 2003, Kathryn Hogg wrote:
>Global variables (a C++ class static members) are typically put in the bss
>(aka DATA) section.

The BSS section is called the 'uninitialized data' section.  While the
DATA section is called the 'initialized data' section.  They are different
sections.

>Plenty of studies have shown that garbage collection is not necessarily a
>road to slowness.  It frees programmers from having to write code to
>(mis)manage memory so the program is free to spend its CPU cycles doing
>what its supposed to.  Just like with virtual functions, a modern garbage
>collector is going to do a better job that something simulated by the user
>like reference counting.

Sooner or later, the CPU will have to spend a lot of cycles performing the
garbage collecting.  I don't think the maintenance of the reference count
itself takes much more CPU cycles than garbage collecting.  Both have
overhead.  The question is whether you need control over when the cycles
are used.

--jc
-- 
Jimen Ching (WH6BRR)      jching at flex.com     wh6brr at uhm.ampr.org


More information about the Programming mailing list