Ignore:
Timestamp:
Apr 7, 2017, 6:17:03 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
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:
b276be5, c51b5a3
Parents:
a0ad7dc
Message:

Update generics paper benchmarks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cfa-stack.c

    ra0ad7dc rd919f47  
     1#include <assert>
    12#include <stdlib>
    23#include "cfa-stack.h"
     
    910forall(otype T) void ?{}(stack(T)* s) {
    1011        (&s->head){ 0 };
     12}
     13
     14forall(otype T) void copy(stack(T)* s, stack(T)* t) {
     15        stack_node(T)** crnt = &s->head;
     16        stack_node(T)* next = t->head;
     17        while ( next ) {
     18                *crnt = ((stack_node(T)*)malloc()){ next->value };
     19                stack_node(T)* acrnt = *crnt;
     20                crnt = &acrnt->next;
     21                next = next->next;
     22        }
     23        *crnt = 0;
    1124}
    1225
     
    5770                delete(crnt);
    5871        }
     72        s->head = 0;
    5973}
Note: See TracChangeset for help on using the changeset viewer.