NAME ^

config/auto/gc.pm - Garbage Collection

DESCRIPTION ^

Checks whether the --gc command-line option was passed to Configure.pl and sets the memory allocator accordingly.

--gc can take the values:

gc

The default. Use the memory allocator in src/recources.c.

libc

Use the C library malloc along with src/gc/res_lea.c. This doesn't work. See [perl #42774].

malloc

Use the malloc in src/malloc.c along with src/gc/res_lea.c. Since this uses res_lea.c, it doesn't work either. See [perl #42774].

malloc-trace

Use the malloc in src/malloc-trace.c with tracing enabled, along with src/gc/res_lea.c. Since this uses res_lea.c, it doesn't work either. See [perl #42774].

    cc_gen('config/auto/gc/test_c.in');
    eval { cc_build(); };
    my $test = 0;
    unless ($@) {
      $test = cc_run();
    }
    cc_clean();
    # used size should be somewhere here
    unless ($test >= 128 && $test < 155) {
      # if not, use own copy of malloc
      $gc = 'malloc';
    }


parrot