source: tests/zombies/gc_no_raii/bug-repro/malloc.c @ bc4a433

ADTast-experimentalenumforall-pointer-decaypthread-emulationqualifiedEnum
Last change on this file since bc4a433 was fd54fef, checked in by Michael Brooks <mlbrooks@…>, 4 years ago

Converting the project to use the new syntax for otype, dtype and ttytpe.

Changed prelude (gen), libcfa and test suite to use it. Added a simple deprecation rule of the old syntax to the parser; we might wish to support both syntaxes "officially," like with an extra CLI switch, but this measure should serve as a simple reminder for our team to try the new syntax.

  • Property mode set to 100644
File size: 424 bytes
RevLine 
[fd54fef]1forall(T)
[273080f]2struct wrapper
3{
4    T val;
5};
6
[fd54fef]7forall(T)
[273080f]8void ctor(wrapper(T)* this)
9{
10    this->val = 0;
11}
12
[fd54fef]13forall(T)
[273080f]14wrapper(T) gcmalloc()
15{
16    wrapper(T) w;
17    ctor(&w);
18    return w;
19}
20
[fd54fef]21forall(T)
[273080f]22wrapper(T)* ?=? (wrapper(T)* lhs, wrapper(T)* rhs)
23{
24    lhs->val = rhs->val;
25    return lhs;
26}
27
28int main(int argc, char *argv[])
29{
30    wrapper(int) test;
31    test = gcmalloc();
32    return 0;
33}
Note: See TracBrowser for help on using the repository browser.