Re: [boost] discussion of garbage collection in C++

Edward Diener wrote:
Also, for people looking for a runtime envrironment for C++, they can look >at Ch.
Or CERN.ROOT.CINT project. Either way we are looking at GC in C++ from the wrong direction. I like to know and be able to determine where the memory allocation deallocation occurs. When the constructor and destructor is called using RAII, however, this doesn't mean I shouldn't use GC. GC is supposed to release unused memory, not to call the destructors of objects; although it does on most implementations. [example bool g(int); for(int i=0; i<10000; i++) { // allocate a memory of size = sizeof(Foo) // then construct an instance of Foo on that memory gc_ptr<Foo> f(new (gc) Foo()); // if g(i) == true, delete the memory if( g(i) ) operator delete(f, gc); } // delete all of the objects. GC::collect(); example] The distinction is between construction/destruction of objects and allocation/deallocation of memory. We let GC to perform allocation/deallocation of memory, while we allow ourselves optionaly to take control of construction/destruction of the objects allocated on that memory. This distinction is so important while everyone ignores :D -- Kasra

Hi, I need boost to compile on VxWorks. But I found Boost.build has built-in feature target-os, in which VxWorks is not supported. "target-os The operating system for which the code is to be generated. The compiler you used should be the compiler for that operating system. This option causes Boost.Build to use naming conventions suitable for that operating system, and adjust build process accordingly. For example, with gcc, it controls if import libraries are produced for shared libraries or not. The complete list of possible values for this feature is: aix, bsd, cygwin, darwin, freebsd, hpux, iphone, linux, netbsd, openbsd, osf, qnx, qnxnto, sgi, solaris, unix, unixware, windows. " Do boost cross-compilation works on VxWorks?? Regards Nandagopal

"Kasra" <kasra_n500@yahoo.com> wrote in message news:589283.19578.qm@web110006.mail.gq1.yahoo.com...
Edward Diener wrote:
Also, for people looking for a runtime envrironment for C++, they can look
at Ch.
Or CERN.ROOT.CINT project.
Either way we are looking at GC in C++ from the wrong direction. I like to know and be able to determine where the memory allocation deallocation occurs. When the constructor and destructor is called using RAII, however, this doesn't mean I shouldn't use GC.
GC is supposed to release unused memory, not to call the destructors of objects; although it does on most implementations.
It is quite possible to invoke destructors of objects in a deterministic way when finalizing gc objects, except when cycles are involved. The test code I have uploaded in boost.vault does exactly that. The direct download link is: http://www.boostpro.com/vault/index.php?action=downloadfile&filename=gc1.zip&directory=Memory& __________ Information from ESET Smart Security, version of virus signature database 4036 (20090427) __________ The message was checked by ESET Smart Security. http://www.eset.com
participants (3)
-
Achilleas Margaritis
-
Govindan, Nandagopal (GE Healthcare)
-
Kasra