Changeset b3763ca


Ignore:
Timestamp:
Aug 8, 2018, 10:54:28 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
cc22003
Parents:
f79cdf8
Message:

delete dynamically allocated storage

Location:
src/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/tests/function-operator.c

    rf79cdf8 rb3763ca  
    1010// Created On       : Fri Aug 25 15:21:11 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec  7 12:42:26 2017
    13 // Update Count     : 6
     12// Last Modified On : Thu Aug  2 09:27:53 2018
     13// Update Count     : 8
    1414//
    1515
     
    9292void ?{}(ostream_iterator & iter, ofstream * out) {
    9393        iter.out = new(out);
    94                 }
     94}
    9595// no destructor, memory leak. This is necessary for this to work at the moment, since
    9696// *? requires its parameter by value and returns a reference.
     
    168168        transform(begin(x), end(x), begin(x), &times2);
    169169        copy(begin(x), end(x), out_iter);
     170
     171        // REMOVE WHEN ?* PROBLEM FIXED.
     172        delete(out_iter.out);
    170173}
    171174
  • src/tests/sum.c

    rf79cdf8 rb3763ca  
    1111// Created On       : Wed May 27 17:56:53 2015
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Sun Jun  3 19:23:41 2018
    14 // Update Count     : 278
     13// Last Modified On : Thu Aug  2 08:03:09 2018
     14// Update Count     : 279
    1515//
    1616
     
    115115        sout | "sum from" | low | "to" | High | "is"
    116116                 | sum( size, gs.x ) | ", check" | (int)s | endl; // add field array in generic type
     117        delete( gs.x );
    117118} // main
    118119
  • src/tests/tuple/tupleVariadic.c

    rf79cdf8 rb3763ca  
    99// Author           : Rob Schluntz
    1010// Created On       : Fri Dec 16 10:25:35 2016
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri Dec 21 14:42:48 2016
    13 // Update Count     : 2
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug  2 09:24:04 2018
     13// Update Count     : 6
    1414//
     15
     16#include <stdlib>
    1517
    1618void func(void) {
     
    2830        printf("called process(double) %g\n", x);
    2931}
    30 
    31 forall( dtype T, ttype Params | sized(T) | { void ?{}(T &, Params); } )
    32 T * new(Params p);
    3332
    3433struct array {
     
    6665        a.data[2] = a2;
    6766        printf("called ?{} with a: %d %d %d\n", a0, a1, a2);
     67}
     68
     69void ^?{}(array & a) {
     70        free(a.data);
    6871}
    6972
     
    126129                bar(x);
    127130        }
     131
     132        delete(ptr);
     133        delete(x4);
     134        delete(x3);
     135        delete(x2);
     136        delete(x1);
     137        delete(x0);
    128138}
    129139
     
    131141// tab-width: 4 //
    132142// End: //
    133 
Note: See TracChangeset for help on using the changeset viewer.