Changeset c5833e8 for src/examples
- Timestamp:
- Apr 15, 2016, 12:02:41 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 0f9e4403
- Parents:
- 8bb59af
- Location:
- src/examples/gc_no_raii/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/gc_no_raii/src/gcpointers.c
r8bb59af rc5833e8 1 1 #include "gcpointers.h" 2 2 3 //#include "gc.h"3 #include "gc.h" 4 4 #include "internal/collector.h" 5 //#include "internal/object_header.h"5 #include "internal/object_header.h" 6 6 // #include "internal/state.h" 7 7 -
src/examples/gc_no_raii/src/vector.h
r8bb59af rc5833e8 9 9 //Declaration 10 10 context allocator_c(type T, type allocator_t) { 11 void realloc ate(allocator_t*, size_t);11 void realloc(allocator_t*, size_t); 12 12 T* data(allocator_t*); 13 13 }; … … 37 37 void reserve(vector(T, allocator_t)* this, size_t size) 38 38 { 39 realloc ate(&this->storage, this->size+1);39 realloc(&this->storage, this->size+1); 40 40 } 41 41 … … 72 72 void push_back(vector(T, allocator_t)* this, T value) 73 73 { 74 realloc ate(&this->storage, this->size+1);74 realloc(&this->storage, this->size+1); 75 75 data(&this->storage)[this->size] = value; 76 76 this->size++; … … 104 104 105 105 forall(type T) 106 void realloc ate(heap_allocator(T)* this, size_t size)106 void realloc(heap_allocator(T)* this, size_t size) 107 107 { 108 108 static const size_t GROWTH_RATE = 2;
Note: See TracChangeset
for help on using the changeset viewer.