Yes you're right that does work, I had to do:

%{
  #include <alloca.h>
%}
#include "share/HATS/temptory_staload_bucs320.hats"
exception MyException of (list_vt(int))

fun test(l : list_vt(int)): void =
    $raise MyException(l)

implement main0(argc,argv) =
  try
    test(list0_vt_cons(1,list0_vt_nil()))
  with
    ~MyException(l) => free l




On Thursday, June 20, 2019 at 9:09:59 PM UTC-5, Richard wrote:
>
> On Thursday, June 20, 2019 at 7:38:57 PM UTC-4, Raoul Duke wrote:
> > Worthy of being a faq type entry? High level question would be, under 
> what-all conditions do we hit such potential leaks?
>
> When the linear resource is not freed before calling 'exit', unhandled 
> exceptions, and unsafe casts.
>
> From what I understand exit is akin to a backdoor. It inherits the return 
> value of an expression. In other words, exit can be any type. I assume that 
> unhandled exceptions are treated similarly. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/1e8b888b-5340-4acc-8f74-cb14a1c53db1%40googlegroups.com.

Reply via email to