commit c8b9c37decb76b4667358e4d95ff928eb9f8fc8c
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Oct 20 21:36:25 2010 -0300

    Adapt conservative default to the compiler support
    
    When compiling the GC with a compiler that doesn't provide PointerMap
    information, the conservative option defaults to true, as most likely the
    GC will be used with programs compiled with the same compiler and all data
    will be scanned conservatively anyway.

commit c7848730fed4af4c843bd887409acfe770a793ba
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Oct 20 21:30:49 2010 -0300

    Avoid compile error for LDC
    
    The variables used in scope(exit) must be declared before the scope
    statement.

commit b5c4d254c9df225484907a78437474f95c3e48c4
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Mon Sep 20 20:30:16 2010 -0300

    Add (optional) early collection support
    
    When early collection is enabled, the collection will be triggered before
    the memory is actually exhausted (the min_free option is used to determine
    how early the collection should be triggered). This could remove a little
    pressure from the GC when eager allocation is not available (or when eager
    allocation makes the heap grow too much).
    
    The option is disabled by default and can be disabled with the
    early_collect option.

commit 7b736090719c6f08e286b246d9b7509413716fcf
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Mon Sep 20 20:25:58 2010 -0300

    Change the min_free default to 5%
    
    Empirical tests shown that the performance is a little better with a lower
    memory footprint.

commit 5b2d2da5852125f6accb61bdaf6eeda0776ebf85
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Mon Sep 20 20:22:36 2010 -0300

    Add (disabled) debug print of overriden options

commit c13d9fa4737aed2c0849b1c73c0c11e2eddbcb28
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Sep 19 21:04:50 2010 -0300

    Make realloc() a little more readable
    
    This is only an aesthetic change, some unneeded indentation is remove by
    removing some "else" blocks when return statements ensures that path
    wouldn't be followed anyway.

commit e888278340bec7db261d6593c42e687f7c29cb59
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Sep 19 20:53:19 2010 -0300

    Abstract how we know if a collection is in progress

commit fab64ab48e28ed336fb0cdc638d656aacb89e614
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Sep 16 00:35:35 2010 -0300

    Accommodate the heap size to the working set size
    
    The GC can have a lot of pressure if a collection recovers very little
    memory, but enough to fulfill the current memory request, causing a lot of
    collections with too little gain (when the key to a efficient GC is
    recover the bigger amount of memory with as little work as possible).
    
    This effect is greatly reduced when using eager allocation, because
    eventually the GC will allocate more memory, but heap minimization can
    trigger this effect again.
    
    This patch adds an option, min_free, which specifies the minimum
    percentage of heap that should be free after a collection. If the free
    heap is less than min_free% of the total heap, the GC will allocate a new
    pool, big enough to fulfill that requirement. If the free heap is bigger
    than min_free% of the total heap, the GC will try to release some pools to
    the OS to keep the heap occupancy near min_free%.

commit fcae2848ff5191cadae251c0a1c5ce3ea66a02b8
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Tue Sep 14 22:15:29 2010 -0300

    Try to keep the memory usage low more aggressively
    
    Memory usage is minimize()d only when a big allocation is done. This could
    be problematic for applications that only perform small objects
    allocation, as their memory usage could grow a lot, specially if the eager
    allocation option is used.
    
    Trigger memory minimization even for small objects allocation to avoid
    that pathological case.

commit 3389bc359d65b04c74bb41ef4b640367cb9aa617
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Tue Sep 14 21:14:17 2010 -0300

    Make bigAlloc() a little bit more readable
    
    bigAlloc() is implemented a weird state machine that even have some paths
    that are not only unreadable, but useless.
    
    The new implementation is still not ideal, but at least a human can read
    it and even understand what's doing.

commit 9d60963df0295d680423c4b133a75ac26db398e2
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Tue Sep 14 20:28:35 2010 -0300

    Use a function to round up sizes to PAGESIZE

commit 8183938bc0141793deae76c17ea182b2774fd0df
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Tue Sep 14 20:14:10 2010 -0300

    Add pre_alloc configuration option
    
    The new option is used to pre-allocate pools of memory at program start.
    This could be useful if your program need to load a starting working set
    into memory before doing the actual work, as it might avoid some useless
    initial collections while the program is just doing allocation but no
    memory is yet freed.
    
    The option takes a numeric parameter indicating the size of the initial
    pool in MiB. It can optionally specify an arbitrary number of pools to
    create by appending "x" and the numeric value of the number of pools. Each
    pool will have the specified pool size.
    
    For exmaple, pre_alloc=50 will allocate an initial pool of 50 MiB, while
    pre_alloc=5x10 will allocate 10 pools with 5 MiB each. Anything that can't
    be parsed correctly (like "", "5x", "5a10", "5x10x", etc.) make the
    starts with no pre-allocated memory as usual.

commit 9457e6cc1d1c824901af4fa8baca99f9b753b9cd
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Sep 9 20:05:55 2010 -0300

    Don't segfault if stats files can't be created
    
    If any stats files (used by collect_stats_file and malloc_stats_file)
    can't be created, the program segfauls trying to use a null FILE*.
    
    It's extremely impolite to cause an strange segfault because of this, and
    since there is no sensible error reporting mechanism either, we just
    ignore those options if the selected files are not writable, as we do
    with unknown options or any other wrong option parameters.

commit c216b75a02d7b09c6949be6ec102b5557a060c08
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Sep 9 18:33:56 2010 -0300

    Change 'no_fork' option to 'fork'
    
    Even when using fork is a little more verbose, since fork=0 must be
    specified to disable forking, it's more consistent with other options.

commit 6a40cbf5959226bf1e6ec7bdb6c7e03253072c28
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Sep 9 00:17:16 2010 -0300

    Add eager allocation support when fork()ing
    
    Eager allocation consist in allocating a new pool when a collection is
    triggered (because an allocation failed to find enough free space in the
    current pools). This enables the mutator to keep running when the mark
    phase run in a fork()ed process in parallel. This completes the concurrent
    GC, decreasing the maximum pause time (not only the stop-the-world time)
    dramatically (almost by 2 orders of magnitude).
    
    As a side effect, the total run-time is greatly reduced too because the GC
    pressure is reduced due to the extra allocated pools. The number of
    collections needed by a program can be reduced 3 to 9 times depending on
    the load, which explains the total run-time reduction, even for
    single-core environments.
    
    To allow the mutator run in parallel with the mark phase, the freebits
    of free pages must be set for *all* the possible block sizes, not only for
    the start of the page, because the freebits are used as a starting point
    for mark bits and the bin size of a freed page can be changed *after* the
    mark phase is started, resulting in an inconsistency between mark bits and
    free bits. Pools allocated during a parallel mark set all the mark bits
    to avoid the sweep phase freeing those pages after the mark is done.

commit b78600681ff7735e523edbae7adfeb3577db0f41
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Sep 5 23:16:26 2010 -0300

    Remove unused code for buggy OSs

commit 3f609656ee57bc578da59dc7fb4d27cdaea2ad18
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Sep 5 19:01:52 2010 -0300

    Build the freebits bit set incrementally
    
    As a side effect, we can't copy anymore the freebits as the starting mark
    bits because we don't keep the freebits updated so precisely, doing so
    would need a bit more work.
    
    Since the freebits can be constructed in the mark phase, which we can do
    in parallel, this might not be as useful as thought at first.

commit e74b77edc55c73d1f1656131a645eed30a59727f
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Sep 5 23:02:45 2010 -0300

    Avoid output duplication because of FILE* buffers
    
    FILE* buffers are duplicated when fork()ing, and at program exit(), the C
    library flushes the FILE* buffers, resulting in duplicated output.
    
    To avoid this we flush all FILE* buffers before fork()ing.

commit cc0ea21e4d2f60ad8cc8c4cc5da47264b8e0dc85
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Sep 3 22:13:06 2010 -0300

    Avoid redundant checks for finals bits
    
    In changeset b28fd72842fc9ce935bed74f7b2ba79f9cc59711 (Run the mark phase
    in a fork()ed process) we inadvertently changed the lazy allocation of
    finals bit set to eager allocation.
    
    This change left a lot of finals bit set initialization checks that are
    not really needed using eager allocation.
    
    We remove this redundant check as we decided to go with the eager
    allocation to trade some space for a little more speed, as the extra
    checks takes time and is very rare that a whole pool doesn't have any
    blocks that need finalization, making the space saving very rare too.
    
    Lazy allocation can impact too in locality of reference, as is more likely
    that all the bit sets are allocated near in space, except for the lazyly
    allocated one.

commit 7e86fae368de25d7134db3e3afa586cdd588fdb6
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Sep 3 22:14:08 2010 -0300

    Improve GCBits invariant

commit 53daba87c2208fcced6c7704dd31932a8a56467b
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Sep 3 22:07:30 2010 -0300

    Clean the cache in the sweep phase

commit f5d58359e009b34defb8457c8fb5dedb77fe16e7
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Sep 3 22:04:46 2010 -0300

    Ensure getInfo() gets a valid base pointer

commit e04cd7f5a7fd412bb98f9631fde20b7856de58dd
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Sep 1 23:50:28 2010 -0300

    Sync the pool block size cache properly
    
    There are some places where the block size change, but the pool's block
    size cache is not updated, which may cause wrong size reporting later.
    
    This patch clears and updates the cache in the place where this
    synchronization was missing.

commit 192f4bfd2ffdaa5e6283bc16e8452fc3c218fb8a
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 29 02:29:59 2010 -0300

    Use integer division to calculate the bit position
    
    Any decent compiler can optimize the division by a power of 2 to a shift.

commit 81dd58ff24106694b223252302afa0d8574414b2
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 29 02:29:37 2010 -0300

    Avoid double initialization of stack variable

commit a6bb99c1425b06fd32a50fa1616f0e73147e326f
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 29 02:28:45 2010 -0300

    Use bool instead of uint for a boolean variable

commit c2e12ed73be29b2680115fbedc3486e77b7dbed5
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Aug 28 23:33:13 2010 -0300

    Cache B_FREE pages also when marking
    
    The small page cache used when marking was only exploited by B_PAGE and
    B_PAGEPLUS pages, while B_FREE pages can benefit from it too.

commit 4cb11bee9ebaae633b3e6a345aeb3eceb4d25d41
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Aug 27 23:46:25 2010 -0300

    Fix some style issues
    
    No functional changes are done, only bogus casts and commented out code
    get removed and style issues fixed.

commit 62b4073393f1d66e88322376627c8bef7b27f81d
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Aug 27 23:45:02 2010 -0300

    Store a pointer to the pool in the free_list
    
    Since the smallest bin size is big enough to store 2 pointers, the free
    list is constructed storing the pointer to the pool the bin belongs to,
    so we don't have to find the pool when operating with the free bin.
    
    To make this work, the pools have to be stored outside the DynArray (and
    store there only pointers) because when inserting sorted, moved pool
    addresses are changed, and the stored pool pointer in the free list break.

commit 0955e008a80ca01988e5f6d4fa8bb7646f4262f4
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Aug 26 18:53:19 2010 -0300

    Check the sentinel invariant in release builds too
    
    When building a release, the sentinel invariant isn't checked, even if the
    "sentinel" option is used. This patches checks the invariant always when
    the option is activated, abort()ing the program if the invariant fails.

commit b4c0bb4114cdbf12c85b793b158b638a8005992e
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Aug 25 22:21:59 2010 -0300

    Improve opts unit tests

commit b28fd72842fc9ce935bed74f7b2ba79f9cc59711
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Aug 25 22:21:32 2010 -0300

    Run the mark phase in a fork()ed process
    
    This is the first big step towards a concurrent GC. The mark phase is ran
    in a fork()ed process and the world is only stopped to do the fork()
    because we need each thread to dump the CPU registers into the stack to
    be scanned.
    
    Forking is controlled via the option "no_fork" (which is false by default).
    If not enough support from the underlying OS is found (i.e. no fork() or
    no shared memory) or if fork() fails, the mark phase fallback to run in
    the same process as the mutator (as it was done before this patch).
    
    The mark and freebits bitmaps are shared between the two processes to
    communicate the results of the mark phase. The freebits could not be
    shared, but in that case the freebits should be set in the mutator process,
    making pauses longer. Freebits should be revisited though.

commit 22d77f1060c88a21da997f5c282e5bff6d512d22
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 22 21:40:17 2010 -0300

    Move marking phase to a separate function

commit 0b6f418d7a9f1b8b2bf9330232e45f92d67005a0
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 22 21:38:50 2010 -0300

    Move sweeping phase to a separate function

commit d8944d1a3011a7b9b2ffcebf41fdb5d6d3b03467
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Aug 19 22:48:57 2010 -0300

    Allow testing for fork() availability
    
    The concurrent GC will fork() to run the collection, so it need to know if
    the underlying OS supports it. This patch renames the alloc module to os
    to group all needed OS abstractions in one module.

commit 961eb25ca3a5f1865be75da53b81bafb32529295
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Aug 19 22:40:30 2010 -0300

    Allow mapping shared memory to allocate bitsets
    
    The concurrent GC will fork() to run the collection, so it need to share
    the mark bits to let the original process know the results of the mark
    phase.

commit 0849555bf578d233e054052f87c55c2cdf46d575
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Aug 19 20:17:49 2010 -0300

    alloc: Use tango to access OS-API

commit b8d5524a8caf4feb1f02e5e7c8d59dfec7747045
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Mon Aug 16 12:41:54 2010 -0300

    Remove unneeded static attribute

commit 27b5b707bcd280cd2cc4e2a2a5cc17eb4e06347a
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Aug 5 23:46:55 2010 -0300

    Revert "Skip non-scanneable words in chunks"
    
    This reverts commit 5578146600d4ace17878e3b010aa09efdb202fb4, because
    doing so many extra tests proved to be a "pessimization" in practice.
    
    Avoiding the extra bit operations does help a little though, so that
    change is not reverted.

commit 2b70a82bd511b6e1bc1f9ae5e0c1a070158c81d6
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Mon Aug 2 00:03:43 2010 -0300

    Add a one element cache to Pool.findSize()
    
    Caching the last findSize() result for big objects gives a huge saving in
    programs with a lot of array appending.

commit 62eb7be845762692491a0c2a228de64f26bbaab2
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 1 23:22:46 2010 -0300

    Do a binary search in findPool()
    
    Since findPool() is sorted, a binary search is more appropriate than
    a linear search.

commit 5578146600d4ace17878e3b010aa09efdb202fb4
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 1 22:01:50 2010 -0300

    Skip non-scanneable words in chunks

commit 876c4089652c85740c66a62899a1e32837e15ad5
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 1 21:59:26 2010 -0300

    Return the real size that can be used in getInfo()
    
    getInfo() was not aware of the sentinel, returning a size larger than the
    size usable by the user. There are probably more places where this
    happens.

commit b5e1601adc7b579e9d2366aa2529b07ee6f47fe3
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 1 15:14:10 2010 -0300

    Remove duplicated code in getInfo()
    
    getInfo() just groups the information obtained via findBase(), findSize()
    and getAttr(), so use those functions instead of duplicating the code.

commit b802e8fe709f22ad56f8a43bc9675c114c2fc21f
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Aug 1 15:09:14 2010 -0300

    Minimize the use of findPool()
    
    findPool() is one of the most used functions in the GC, usually taking 15%
    of the GC time. This patch minimizes it use by converting the functions
    findBase() and findSize() to Pool methods, avoiding calling findPool()
    twice (in most cases, when calling findBase() or findSize() we already
    know the pool).

commit f9b8f3cb780edcdceda2027e96f69a2244c9cc29
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Jul 31 13:44:06 2010 -0300

    Group extern (C) declarations

commit 7a593497e5dddf15c8407e2faaf2c2e02db80ccd
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Jul 31 13:37:45 2010 -0300

    Move the locking to the C interface

commit 67f00b96c70725ee445641a158a97fe4f6e735d3
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Jul 30 23:43:53 2010 -0300

    Convert methods to free functions
    
    Making the GC an object makes no sense, since you can't instantiate it
    more than once, it just make the code unnecessarily extra indented.
    
    The GC struct now only have attributes (several renamed) and they are only
    grouped for clarity (and to make easier to calculate the GC memory
    overhead). All methods are converted to free functions that uses a global
    instance of the GC struct.

commit c727ff521a84db2e82821a40131d91c983d9a040
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Jul 29 21:15:36 2010 -0300

    Merge iface.d in gc.d
    
    There is no reason to be in different files, really, it just makes things
    harder.

commit 15b00d2668aff0f632ebf9e187496f45720dfb32
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Jul 29 20:55:36 2010 -0300

    Rename the global lock and remove staticness
    
    It doesn't make any sense to make it static, since all the GC struct can't
    be instantiated more than once anyway.

commit 60c2ff134a50c1196ebfbce3c823fcac619fd043
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Jul 29 00:59:49 2010 -0300

    Unify GC class and Gcx struct
    
    For some unknown reason, the GC implementation was divided in 2, a GC
    class and a Gcx struct. This patch unify them in a GC struct. Only code is
    moved (and stats are adjusted).

commit 0cc16f584aa0cf5f588e01dc4234809022f9bd22
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jul 28 19:43:55 2010 -0300

    Remove obsolete unused variables

commit 6a3232d8f1c52377e792b4f4e18fd75f2a3b0f60
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jul 28 17:41:36 2010 -0300

    Make heap precise scanning optional
    
    Now D_GC_OPTS accepts a new boolean option: conservative. When true, the
    heap is scanned conservatively, even when type information is available.
    The option defaults to false.

commit ed2b4ee35ae9c3c6fb0f9c0a808c2945a843701a
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jul 28 17:39:30 2010 -0300

    opts: Fix parsing a single boolean option without args

commit c33a7fef45ad744fec816366c531a2dd70938b2b
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jul 28 16:36:16 2010 -0300

    stats: Refactor code to avoid duplication

commit e553181b45ebc12d0cd2b7f20616b86f0261292d
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jul 28 01:20:45 2010 -0300

    stats: Add more type information to malloc logging

commit 13761bd8269f2230742d6befddf3a3154b1ee610
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jul 28 00:12:10 2010 -0300

    stats: Log the pointer to the allocated memory

commit 3f06cf8417c07b73c6e9671f379ec6f942f63866
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Tue Jul 27 23:40:46 2010 -0300

    Make heap scanning precise
    
    This patch[1] is based on the patch provided by Vincent Lang (AKA wm4),
    which was based on a patch[2] by David Simcha, both published in the bug
    3463[3]. The patch needs a patched Tango runtime (which is part of the
    patch[1] for the GC) and a patched[4] DMD to work.
    
    The patched DMD passes type information about pointer locations to
    allocations, a PointerMap. The PointerMap has a member bits, which is an
    array of size_t elements. The first element is the T.sizeof / size_t,
    where T is the type being allocated. The next elements are bitmask
    indicating words that should be scanned. After that, the next elements
    store another bitmask with the information about pointers. A moving
    collector could change the value of words marked as pointers, but not
    words that should only be scanned (that words are not guaranteed to be
    pointers), so a block could only be moved if it's only reachable by
    pointers. The pointers information is not used yet by this patch, only the
    scan bits are used.
    
    The precise scanning algorithm is extremely simple, and needs a lot of
    optimization, this patch was kept simple on purpose. Optimizations will
    follow in separated patches.
    
    A pointer to the type information is stored at the end of the allocated
    blocks (only if the blocks should be scanned, blocks marked with NO_SCAN
    don't need the type information). This wastes some space, and space that
    then have to be scanned, which tends to decrease the performance quite
    a bit.
    
    [1] http://d.puremagic.com/issues/attachment.cgi?id=696
    [2] http://d.puremagic.com/issues/attachment.cgi?id=489
    [3] http://d.puremagic.com/issues/show_bug.cgi?id=3463
    [4] http://d.puremagic.com/issues/attachment.cgi?id=700

commit 39229a694674a24ad2d3b9203f591198b7c60ca7
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jul 21 13:45:27 2010 -0300

    Improve variable names for block attributes

commit 7e73b6245c0d7f6af8da2228a2fdbc9404ad69ec
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jun 9 19:47:05 2010 -0300

    Add statistics collection
    
    Statistics meassure this metrics.
    
    For each collection:
    
    * Time spent in the malloc that triggered the collection.
    * Time spent with the world stopped.
    * Time spent doing the collection.
    * Memory info before and after the collection: used, free, overhead and
      wasted memory. Used is the memory used by the mutator, free is the
      memory the mutator can request, overhead is the memory used by the
      collector itself and wasted is memory that is not used by either the
      mutator or collector and that can't be requested by the mutator either.
    
    For each malloc() call:
    
    * Time spent.
    * Amount of memory requested.
    * Attributes of the requested memory.
    * A flag to tell if this call triggered a collection.
    
    Statistics collection is controlled via the D_GC_OPTS environment
    variable. To collect malloc statistics, use the option
    malloc_stats_file, the value is the path to the file where to store the
    malloc statistics (the contents will be replaced). To collect garbage
    collection statistics, use the option collect_stats_file, the value is
    the path to the file where to store the malloc statistics (the contents
    will be replaced). The generated files are in CSV format and have
    headers that make them self explanatory.

commit a62e962184cb5304bd18a4bd49edb217f9897fbd
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Mon Jul 19 13:24:30 2010 -0300

    Make the GC configurable at runtime via env vars
    
    The GC offers a couple of options to debug memory problems, but they are
    selectable only at compile-time. Being the GC part of the compiler
    runtime, is not very common for the user to recompile the GC when it has
    a memory problem, so making this option available always is very
    desirable.
    
    This patch allows configuring the GC via environment variables. 4 options
    are available: sentinel, mem_stomp, verbose and log file. Only the first
    2 are implemented right now.
    
    For example, to check a program using memory stomping and a sentinel, you
    can run it like this (using sh):
    
    	$ D_GC_OPTS=mem_stop=1:sentinel
    
    As you can see, the value is optional for boolean options.

commit 11b7fc5cdb1df190c6c434fea14a00e700721fbc
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Jul 2 23:31:57 2010 -0300

    Call memset() only for large enough chunks of data
    
    Calling memset() for small memory chunks can be expensive compared to
    a simple loop.

commit dd0f3b1617e380408f300f48c455e2905b859067
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jun 30 10:58:46 2010 -0300

    Use a DynArray to store the memory pools

commit 587bbcb1896f084939cb30c4255de18d37eb6f84
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jun 30 10:58:20 2010 -0300

    Use a few more initial elements by default
    
    Moving from 4 to 16 can improve the performance a little for short lived
    programs.

commit e22e481ad2881b43acdc16fd6061bee9d68270f7
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jun 30 10:57:18 2010 -0300

    Use a custom dynamic array to store roots and ranges

commit 58601dba4eeea662fb023c1f8c491bf4f6bb0668
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Mon Jun 28 21:09:55 2010 -0300

    Remove Gcx destructor
    
    There is no point on freeing memory as the OS will do it for us.

commit d512e824a57ab7912ce0c57798a8560479637c10
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Tue Jun 22 00:39:50 2010 -0300

    Comment why we avoid calling free with null
    
    Even when free() can be called with a null pointer, the extra call might
    be significant. On hard GC benchmarks making the test for null in the GC
    code (i.e. avoiding the free() call) can reduce the GC time by almost ~5%.

commit 5b9125d77fe31ab9bc0b772db804b0fa9fd81982
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Mon Jun 21 20:13:51 2010 -0300

    Remove debug LOGGING code
    
    This code will be superseded by the statistic collection code, and it was
    unmantained and very probably broken (for example, the file and line
    number was never filled in).

commit 2ede6aa954704e0e386f99a6d88364f60dcf5107
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jun 9 19:48:51 2010 -0300

    Add VIM modeline to avoid style errors

commit f79a30ddeee392a4f3d6aaf6ade2151a192097cc
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jun 9 19:41:47 2010 -0300

    Use tango bindings to C standard library functions
    
    As we need to use more libraries it became less practical to maintain our
    own set of bindings, and since the GC only works with Tango, it makes
    sense to just use Tango bindings.

commit 0c03b35e455d2c8bb2c50bb2cdaf3b1538431a0a
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun May 30 20:13:06 2010 -0300

    Remove PRINTF debug statements

commit 624a6db4949f3e3a7ebba7506166e0f9d4be3e5e
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat May 29 22:45:06 2010 -0300

    Fix minor coding style issues

commit 894bf556097247f161a48f380424ea0e8180f393
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat May 29 22:44:49 2010 -0300

    Use more explicit imports

commit 2b1e1065120ee46e3f4331f1827cc2b3e1fe175d
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat May 29 20:21:30 2010 -0300

    Add missing import for DMD

commit 004b7e95d7c07045ff197463abf3eab1e9d353ac
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat May 29 20:11:07 2010 -0300

    Move the modules to package rt.gc.cdgc
    
    Tango 0.99.9 uses this package scheme, so we follow it for easier
    integration.

commit a4312e0cb839e7be200452f2b8d8733d05e9b58d
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat May 29 20:02:24 2010 -0300

    Minor formatting fixes

commit 619a72ba893b8262f8d0946183aaa90964f893d5
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat May 29 19:54:04 2010 -0300

    Add weak reference support for Tango 0.99.9

commit 9037ef3e51af8c40168a08911ac30650f882ee81
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jan 20 23:38:38 2010 -0300

    Remove the MULTI_THREADED version
    
    This will be an inherently concurrent GC, so having a non-threaded version
    of it makes no sense. Even more, I think the non-threaded doesn't even
    compile.

commit 9fac8d774138f03d80061c243400b67b48879fd5
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Jan 17 18:29:52 2010 -0300

    Remove (un)committed pages distinction
    
    This distinction is only made by Windows, and adds an extra complexity
    that probably doesn't worth it (specially for other OSs, where this adds
    a little overhead too, in both space and time).
    
    Other OSs (like Linux) even do all the committing automatically, under the
    hood, see:
    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;\
    f=Documentation/vm/overcommit-accounting;hb=HEAD

commit 5baa584e06b7cfbcdb9de30efe0092033adcd9e1
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Jan 16 21:48:12 2010 -0300

    Make allocation functions that can fail return bool
    
    There is no point on returning int, since no error code is returned, just
    failure or success.

commit fdc67622a72cf5863d7faa6667f5e526b524568c
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Jan 16 21:14:07 2010 -0300

    Fix spacing style

commit 10d737a6141dc366b9609c28f251def8b337f3c4
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Jan 16 21:01:04 2010 -0300

    Declare public allocation API
    
    Declare the public API and move comments to the declaration, to avoid
    duplication and let ddoc document the functions for all versions.

commit 28078ce1ede1d2b4535e9f44bde1466c4912a910
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Jan 16 20:45:22 2010 -0300

    Remove valloc() allocation method
    
    Almost any system that support valloc() supports mmap(), and being
    a deprecated function, it makes not much sense to maintain it as an
    allocation method.

commit ec73552782f845e080e7c46324201351f7df30f2
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Jan 16 20:43:54 2010 -0300

    Make sure MAP_ANON exists when using mmap()

commit 47fe9469dbf40c3fc0f93ded6825ab4405357fab
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sat Jan 16 20:40:15 2010 -0300

    Remove commented out code

commit f102613fc4eccc2bc732885bf78aeaa8804b9208
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Jan 15 21:29:31 2010 -0300

    Remove Tango dependency
    
    To avoid Tango dependency, we need to write our own C-API interface. This
    is done in the new gc.libc module. In the future, maybe this module will
    use Tango or Phobos accordly, but for now we stay free of dependencies (at
    the expense of some extra work).

commit b8af9d3c77843fc75c260f6c95028f769015532c
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Fri Jan 15 21:34:25 2010 -0300

    Remove debug version THREADINVARIANT
    
    The code seemed to be broken, since the self thread ID was stored at
    initialization and then asserted that the GC always run from that thread,
    which seems far from reality (the GC can be invoked by any thread).
    
    The PRINTF version now doesn't print the current thread ID either.

commit 561273a63d42eff2a91b348781f1927ec0a6d7c6
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Wed Jan 13 23:29:33 2010 -0300

    Rename module names to make more sense

commit a22fb3227c03bdc818b820bf597277206c03f70b
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Sun Jan 3 15:20:21 2010 -0300

    Make gc a package

commit 045edac361c6b9624a3fcd551edd23f7f75608ce
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Dec 24 20:22:19 2009 -0300

    Add a "clean" target to the Makefile

commit 9aada2930522a2ef5f46d66e947b7b535ecb1b75
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Dec 24 20:20:57 2009 -0300

    Put built stuff in a separated build directory

commit ed081900ebd31e9a96c4220641039828ed6b6afd
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Dec 24 20:16:01 2009 -0300

    Add a wrapper script to run programs using CDGC

commit 4ec407bc566f7213d53848ac42ed501cab22a792
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Dec 24 20:10:28 2009 -0300

    Remove redundant "private" from import statements
    
    Since a long while ago, imports are "private" by default.

commit 2e05ad088dcc9c1522910bf3ae65d9d3240fb778
Author: Leandro Lucarella <llucax@gmail.com>
Date:   Thu Dec 24 19:56:49 2009 -0300

    Concurrent D Garbage Collector initial commit
    
    The Concurrent D Garbage Collector (CDGC) is based on the "basic" garbage
    collector from the Tango runtime. This first commit is a copy of this GC,
    as it is in Tango 0.99.8.
    
    The CDGC is designed only for Linux, at least for now.
