Ignore:
Timestamp:
Aug 19, 2016, 2:42:04 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
e85a8631
Parents:
03da511 (diff), ac71a86 (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.
Message:

Merge branch 'master' into ctor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/examples/gc_no_raii/src/gc.h

    r03da511 r04cdd9b  
    44#include "internal/collector.h"
    55
     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
    615forall(otype T)
    7 static inline gcpointer(T) gcmalloc()
     16static inline void gcmalloc(gcpointer(T)* ptr)
    817{
    9     gcpointer(T) ptr;
    10     void* address = gc_allocate(sizeof(T));
    11     (&ptr){ address };
    12     ctor(&ptr, address);
    13     gc_conditional_collect();
    14     return ptr;
     18        ptr { gc_allocate(sizeof(T)) };
     19        get(ptr) {};
     20      gc_conditional_collect();
    1521}
Note: See TracChangeset for help on using the changeset viewer.