Changeset 6943a987 for src/examples/gc_no_raii/src/gc.h
- Timestamp:
- Aug 29, 2016, 10:33:05 AM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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:
- 5e644d3e
- Parents:
- 79841be (diff), 413ad05 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/examples/gc_no_raii/src/gc.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/examples/gc_no_raii/src/gc.h
r79841be r6943a987 4 4 #include "internal/collector.h" 5 5 6 forall(otype T)7 static inline gcpointer(T) gcmalloc()8 {9 gcpointer(T) ptr = { gc_allocate(sizeof(T)) };10 ptr{};11 gc_conditional_collect();12 return ptr;13 }6 // forall(otype T) 7 // static inline gcpointer(T) gcmalloc() 8 // { 9 // gcpointer(T) ptr = { gc_allocate(sizeof(T)) }; 10 // ptr{}; 11 // gc_conditional_collect(); 12 // return ptr; 13 // } 14 14 15 15 forall(otype T) 16 16 static inline void gcmalloc(gcpointer(T)* ptr) 17 17 { 18 ptr { gc_allocate(sizeof(T)) };19 (*ptr){};18 ptr { gc_allocate(sizeof(T)) }; 19 get(ptr) {}; 20 20 gc_conditional_collect(); 21 21 }
Note:
See TracChangeset
for help on using the changeset viewer.