GC-8.2.12

#### Beyond Linux® From Scratch (System V Edition) - Version r13.0-584

### Chapter 13. Programming

- Prev

  GCC-15.2.0

- Next

  GDB-17.1

- Up
- Home

# GC-8.2.12

## Introduction to GC

The GC package contains the Boehm-Demers-Weiser conservative garbage collector, which can be used as a garbage collecting replacement for the C malloc function or C++ new operator. 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.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://github.com/bdwgc/bdwgc/releases/download/v8.2.12/gc-8.2.12.tar.gz

- Download MD5 sum: 5e7c74f8bd57f64d3f86673ff3c17230

- Download size: 1.2 MB

- Estimated disk space required: 9.4 MB (with tests)

- Estimated build time: 0.1 SBU (with tests)

### GC Dependencies

#### Optional

libatomic_ops-7.10.0

## Installation of GC

Install GC by running the following commands:

    ./configure --prefix=/usr      \
                --enable-cplusplus \
                --disable-static   \
                --docdir=/usr/share/doc/gc-8.2.12 &&
    make

To test the results, issue: make check.

Now, as the `root` user:

    make install &&
    install -v -m644 doc/gc.man /usr/share/man/man3/gc_malloc.3

## Command Explanations

`--docdir=/usr/share/doc/gc-8.2.12`: This option is used so the package will install the documentation in a versioned directory.

`--enable-cplusplus`: This parameter enables the building and installing of the C++ library along with the standard C library.

`--disable-static`: This switch prevents installation of static versions of the libraries.

## Contents

Installed Programs: None
Installed Libraries: libcord.so, libgc.so, libgccpp.so, and libgctba.so
Installed Directories: /usr/include/gc and /usr/share/doc/gc-8.2.12

### Short Descriptions

`libcord.so` | contains a tree-based string library
`libgc.so` | contains a C interface to the conservative garbage collector, primarily designed to replace the C malloc function
`libgccpp.so` | contains a C++ interface to the conservative garbage collector
`libgctba.so` | contains a C++ interface to throw bad allocations

- Prev

  GCC-15.2.0

- Next

  GDB-17.1

- Up
- Home