Re: Ignored proof leaks memory

2017-09-21 Thread aditya siram
Just saw this. IMO, the policy is fine and reasonable. Now that I know it, 
it makes more sense. It's just me bringing in expectations from other 
language.
Thanks!

On Sunday, September 17, 2017 at 11:20:38 AM UTC-5, gmhwxi wrote:
>
> Currently, if you use _ to match a linear proof, then the proof is
> automatically discarded.
>
> Maybe the policy is too liberal :)
>
> The opposite is to disallow the use of _ to match linear proofs.
>
> Currently, the following code is supposedly for obtaining a pointer
> that can be used externally in C:
>
> implement main0 () =
>   let
> val (_, _ | p) = malloc_gc (sizeof)
>   in
> ()
>   end
>
> On Sun, Sep 17, 2017 at 12:12 PM, aditya siram  > wrote:
>
>> Hi,
>> I was wondering if the following is a bug. First off as expected this 
>> fails to typecheck complaining about unconsumed linear resources:
>> implement main0 () =
>>   let
>> val (pf, pfgc | p) = malloc_gc (sizeof)
>>   in
>> ()
>>   end
>>
>> But this passes typechecking and 'valgrind' detects that it leaks 4 bytes 
>> of memory:
>>
>> implement main0 () =
>>   let
>> val (_, _ | p) = malloc_gc (sizeof)
>>   in
>> ()
>>   end
>>
>> The compiler is built from the head of ATS development tree.
>> Thanks!
>> -deech
>>
>> -- 
>> 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 ats-lang-user...@googlegroups.com .
>> To post to this group, send email to ats-lan...@googlegroups.com 
>> .
>> 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/dedecc02-44b8-42ce-adc5-20a94bb571f5%40googlegroups.com
>>  
>> 
>> .
>>
>
>

-- 
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 ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
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/6c06abad-6f64-4cc8-b09d-f3d486216c6d%40googlegroups.com.


Ignored proof leaks memory

2017-09-17 Thread aditya siram
Hi,
I was wondering if the following is a bug. First off as expected this fails 
to typecheck complaining about unconsumed linear resources:
implement main0 () =
  let
val (pf, pfgc | p) = malloc_gc (sizeof)
  in
()
  end

But this passes typechecking and 'valgrind' detects that it leaks 4 bytes 
of memory:

implement main0 () =
  let
val (_, _ | p) = malloc_gc (sizeof)
  in
()
  end

The compiler is built from the head of ATS development tree.
Thanks!
-deech

-- 
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 ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
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/dedecc02-44b8-42ce-adc5-20a94bb571f5%40googlegroups.com.