1. Introduction 1.1. Project/Component Working Name: The Boehm-Demers-Weiser garbage collector 1.2. Name of Document Author/Supplier: jerry tan 1.3. Date of This Document: 01/29/08 1.3.1. Date this project was conceived: 11/08/07 1.4. Name of Major Document Customer(s)/Consumer(s): 1.4.1. The PAC or CPT you expect to review your project: Solaris PAC 1.4.2. The ARC(s) you expect to review your project: LSARC 1.4.3. The Director/VP who is "Sponsoring" this project: robert.odea@sun.com 1.4.4. The name of your business unit: OPG / OpenSource. 1.5. Email Aliases: 1.5.1. Responsible Manager: paul.mei@sun.com 1.5.2. Responsible Engineer: jerry.tan@sun.com 1.5.3. Marketing Manager: dan.roberts@sun.com 1.5.4. Interest List: jds-dev@sun.com 2. Project Summary 2.1. Project Description: The Boehm-Demers-Weiser conservative garbage collector is a garbage collector for C and C++. 2.2. Risks and Assumptions: None 4. Technical Description: 4.1. Details: The Boehm-Demers-Weiser conservative garbage collector can be used as a garbage collecting replacement for C malloc or C++ new. It allows you to allocate memory basically as you normally would, without explicitly deallocating memory that is no longer useful. The collector automatically recycles memory when it determines that it can no longer be otherwise accessed. The collector is also used by a number of programming language implementations that either use C as intermediate code, want to facilitate easier interoperation with C libraries, or just prefer the simple collector interface. Alternatively, the garbage collector may be used as a leak detector for C or C++ programs, though that is not its primary goal. There are many projects that use gc, including The runtime system for GCJ, the static GNU java compiler. W3m, a text-based web browser. Some versions of the Xerox DocuPrint printer software. The Mozilla project, as leak detector. The Mono project, an open source implementation of the .NET development framework. see more at http://www.hpl.hp.com/personal/Hans_Boehm/gc/#users Here is one example how to use libgc #include "gc.h" #include #include int main() { int i; GC_INIT(); for (i = 0; i < 10000000; ++i) { int **p = (int **) GC_MALLOC(sizeof(int *)); int *q = (int *) GC_MALLOC_ATOMIC(sizeof(int)); assert(*p == 0); *p = (int *) GC_REALLOC(q, 2 * sizeof(int)); if (i % 100000 == 0) printf("Heap size = %d\n", GC_get_heap_size()); } return 0; } 4.2. Bug/RFE Number(s): None. 4.3. In Scope: See above. 4.4. Out of Scope: See above. 4.5. Interfaces: -------------------------------------------------------------------- Exported Stability Comments -------------------------------------------------------------------- /usr/lib/libcord.so Volatile library /usr/lib/libgc.so Volatile library /usr/include/gc/*.h Volatile header files /usr/lib/pkgconfig/bdw-gc.pc Volatile package config file SUNWlibgc Uncommitted package Name SUNWlibgc-devel Uncommitted dev package Name -------------------------------------------------------------------- Imported Stability Comments -------------------------------------------------------------------- SUNWlibms Committed LSARC/2003/279 4.6. Doc Impact: add some docs under /usr/share/gc/ 4.7. Admin/Config Impact: None. 4.8. HA Impact: None. 4.9. I18N/L10N Impact: The JDS team and the G11N are working together to evaluation and provide I18N/L10N support 4.10. Packaging & Delivery: Adds new packages, SUNWlibgc, SUNWlibgc-devel 4.11. Security Impact: None. 4.12. Dependencies: None 5. Reference Documents: http://www.hpl.hp.com/personal/Hans_Boehm/gc/