Changeset 24bc651
- Timestamp:
- Sep 16, 2016, 11:14:12 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, 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
- Location:
- src/examples/gc_no_raii/src/internal
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/gc_no_raii/src/internal/card_table.h
rfc4a0fa r24bc651 18 18 }; 19 19 20 static inline void ctor_card(card_table_t* constthis)20 static inline void ?{}(card_table_t* this) 21 21 { 22 22 this->count = 0; 23 23 } 24 24 25 static inline void dtor_card(card_table_t* constthis)25 static inline void ^?{}(card_table_t* this) 26 26 { 27 27 -
src/examples/gc_no_raii/src/internal/memory_pool.c
rfc4a0fa r24bc651 11 11 const size_t gc_pool_header_size = (size_t)( &(((gc_memory_pool*)NULL)->start_p) ); 12 12 13 void ctor(gc_memory_pool *constthis, size_t size, gc_memory_pool* next, gc_memory_pool* mirror, uint8_t type)13 void ?{}(gc_memory_pool* this, size_t size, gc_memory_pool* next, gc_memory_pool* mirror, uint8_t type) 14 14 { 15 15 this->mirror = mirror; … … 17 17 this->type_code = type; 18 18 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)) ){}; 22 20 23 21 this->end_p = ((uint8_t*)this) + size; … … 29 27 } 30 28 31 void dtor(gc_memory_pool *constthis)29 void ^?{}(gc_memory_pool* this) 32 30 { 33 dtor_card(this->cards);31 ^(&this->cards){}; 34 32 free(this->cards); 35 33 } -
src/examples/gc_no_raii/src/internal/memory_pool.h
rfc4a0fa r24bc651 27 27 }; 28 28 29 void ctor( gc_memory_pool *constthis,29 void ?{}( gc_memory_pool* this, 30 30 size_t size, 31 31 gc_memory_pool* next, … … 34 34 ); 35 35 36 void dtor(gc_memory_pool *constthis);36 void ^?{}(gc_memory_pool* this); 37 37 38 38 struct gc_pool_object_iterator -
src/examples/gc_no_raii/src/internal/state.c
rfc4a0fa r24bc651 131 131 132 132 this->from_space = (gc_memory_pool*)(pal_allocPool(POOL_SIZE_BYTES, 1)); 133 this->to_space = (gc_memory_pool*)(pal_allocPool(POOL_SIZE_BYTES, 1));134 135 ctor(this->from_space, POOL_SIZE_BYTES, old_from_space, this->to_space, this->from_code);136 ctor(this->to_space, POOL_SIZE_BYTES, old_to_space, this->from_space, (~this->from_code) & 0x01);133 this->to_space = (gc_memory_pool*)(pal_allocPool(POOL_SIZE_BYTES, 1)); 134 135 this->from_space{ POOL_SIZE_BYTES, old_from_space, this->to_space, this->from_code }; 136 this->to_space { POOL_SIZE_BYTES, old_to_space, this->from_space, (~this->from_code) & 0x01 }; 137 137 138 138 this->total_space += gc_pool_size_used(this->from_space);
Note: See TracChangeset
for help on using the changeset viewer.