Ignore:
Timestamp:
Aug 18, 2016, 10:08:31 AM (10 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
Children:
7a5d773
Parents:
926af74
Message:

first basic test for garbage collector now compiles and works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/examples/gc_no_raii/src/internal/collector.c

    r926af74 r6643e72  
    88}
    99#endif
     10
     11#include <fstream>
    1012
    1113#include "state.h"
     
    3638void* gc_allocate(size_t target_size)
    3739{
     40        sout | "Allocating " | target_size | " bytes" | endl;
     41
    3842        size_t size = gc_compute_size(target_size + sizeof(gc_object_header));
     43
     44        sout | "Object header size: " | sizeof(gc_object_header) | " bytes" | endl;
     45        sout | "Actual allocation size: " | size | " bytes" | endl;
    3946
    4047        check(size < POOL_SIZE_BYTES);
Note: See TracChangeset for help on using the changeset viewer.