Ignore:
Timestamp:
Sep 16, 2016, 11:14:12 AM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
bd34fc87
Parents:
fc4a0fa
Message:

now using proper ctor semantics for more objects in gc

File:
1 edited

Legend:

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

    rfc4a0fa r24bc651  
    1111const size_t gc_pool_header_size = (size_t)(  &(((gc_memory_pool*)NULL)->start_p) );
    1212
    13 void ctor(gc_memory_pool *const this, size_t size, gc_memory_pool* next, gc_memory_pool* mirror, uint8_t type)
     13void ?{}(gc_memory_pool* this, size_t size, gc_memory_pool* next, gc_memory_pool* mirror, uint8_t type)
    1414{
    1515        this->mirror = mirror;
     
    1717        this->type_code = type;
    1818
    19         card_table_t* new = (card_table_t*)malloc(sizeof(card_table_t));
    20         this->cards = new;
    21         ctor_card(this->cards);
     19        this->cards = ( (card_table_t*)malloc(sizeof(card_table_t)) ){};
    2220
    2321        this->end_p = ((uint8_t*)this) + size;
     
    2927}
    3028
    31 void dtor(gc_memory_pool *const this)
     29void ^?{}(gc_memory_pool* this)
    3230{
    33         dtor_card(this->cards);
     31        ^(&this->cards){};
    3432        free(this->cards);
    3533}
Note: See TracChangeset for help on using the changeset viewer.