Re: [Chicken-users] set-file-position! only works with fixnums

2009-09-30 Thread Thomas Bushnell BSG
On Wed, 2009-09-30 at 17:32 -0700, Kon Lovett wrote:
> On Sep 29, 2009, at 7:55 AM, John Cowan wrote:
> 
> > In the posix unit, you should be able to pass an integral flonum to
> > set-file-position!  and get one back from file-position so that files
> > longer than 2^31 bytes can be handled.
> 
> Thank you. It will be fixed.

I think this is a mistake, but "fixing" it is harder than it seems.

Really, this is totally non-schemey.  

The criterion should be an exact integer, just as it is for arrays.
Instead of allowing inexact integers to be file positions, how about
extending the hierarchy to handle these cases directly?





___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] set-file-position! only works with fixnums

2009-09-30 Thread Kon Lovett


On Sep 29, 2009, at 7:55 AM, John Cowan wrote:


In the posix unit, you should be able to pass an integral flonum to
set-file-position!  and get one back from file-position so that files
longer than 2^31 bytes can be handled.


Thank you. It will be fixed.



--
A witness cannot give evidence of his   John Cowan
age unless he can remember being born.  co...@ccil.org
 --Judge Blagden   http://www.ccil.org/~cowan


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Best Wishes,
Kon




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] confusion tracking down memory leak

2009-09-30 Thread Thomas Bushnell BSG
I found my leak, for those interested.  The Chicken mysql egg magically
stores results away inside mysql-query, which you must free with
mysql-free-result, even though they are unreachable once another
mysql-query has intervened.

Thomas


On Wed, 2009-09-30 at 21:11 +0200, Andreas Rottmann wrote:
> Thomas Bushnell BSG  writes:
> 
> > I have a memory leak in a long-running program; I can easily provoke it.
> > (It's quite complex; too complex to post here.)
> >
> > The program involves lots of FFI interfaces to Linux syscalls, and other
> > stuff.
> >
> > The memory leak is *not* in Scheme; this is verified by the fact that
> > (memory-statistics) while it's running shows bounded memory consumption.
> >
> > Yet the heap usage is growing without limit.  There's bad malloc going
> > on somewhere.  
> >
> > Are there any convenient tools to try and figure out malloc usage in
> > Chicken Scheme?
> >
> Dunno specifically about Chicken Scheme (and "convinient" ;-), but given
> the fact that your leak is in C code, you might be able to make sense
> from Valgrind[0] output -- for C/C++ this works great, usually.
> 
> [0] http://valgrind.org/
> 
> Regards, Rotty



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] confusion tracking down memory leak

2009-09-30 Thread Thomas Bushnell BSG
Indeed, I have discovered that the memory allocations in question are
the responsibility of the mysql client library.  Either there is a bug
in it, or there is a memory bug in the FFI in the mysql egg.  But I'm on
the chase. :)

Thomas


On Wed, 2009-09-30 at 21:11 +0200, Andreas Rottmann wrote:
> Thomas Bushnell BSG  writes:
> 
> > I have a memory leak in a long-running program; I can easily provoke it.
> > (It's quite complex; too complex to post here.)
> >
> > The program involves lots of FFI interfaces to Linux syscalls, and other
> > stuff.
> >
> > The memory leak is *not* in Scheme; this is verified by the fact that
> > (memory-statistics) while it's running shows bounded memory consumption.
> >
> > Yet the heap usage is growing without limit.  There's bad malloc going
> > on somewhere.  
> >
> > Are there any convenient tools to try and figure out malloc usage in
> > Chicken Scheme?
> >
> Dunno specifically about Chicken Scheme (and "convinient" ;-), but given
> the fact that your leak is in C code, you might be able to make sense
> from Valgrind[0] output -- for C/C++ this works great, usually.
> 
> [0] http://valgrind.org/
> 
> Regards, Rotty



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] confusion tracking down memory leak

2009-09-30 Thread Andreas Rottmann
Thomas Bushnell BSG  writes:

> I have a memory leak in a long-running program; I can easily provoke it.
> (It's quite complex; too complex to post here.)
>
> The program involves lots of FFI interfaces to Linux syscalls, and other
> stuff.
>
> The memory leak is *not* in Scheme; this is verified by the fact that
> (memory-statistics) while it's running shows bounded memory consumption.
>
> Yet the heap usage is growing without limit.  There's bad malloc going
> on somewhere.  
>
> Are there any convenient tools to try and figure out malloc usage in
> Chicken Scheme?
>
Dunno specifically about Chicken Scheme (and "convinient" ;-), but given
the fact that your leak is in C code, you might be able to make sense
from Valgrind[0] output -- for C/C++ this works great, usually.

[0] http://valgrind.org/

Regards, Rotty
-- 
Andreas Rottmann -- 


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users