Re: [racket-users] Safely allocating memory in places enabled world

2017-10-04 Thread Matthew Flatt
At Mon, 2 Oct 2017 16:48:40 -0400, George Neuner wrote: > > On 10/2/2017 2:52 PM, Matthew Flatt wrote: > > Meanwhile, there's no similar way to order > > callbacks that are registered with a custodian. > > IIRC, the JVM executes finalizers in reverse order of registration - > expecting that, in

Re: [racket-users] Safely allocating memory in places enabled world

2017-10-02 Thread George Neuner
Hi Eric, On 10/2/2017 9:40 PM, Eric Dobson wrote: George: I don't see that invariant for java in anything that I search for on Java finalizers. Do you have a reference? In particular java only has one finalizer per object (the finalize method) and across objects the references I found seem to

Re: [racket-users] Safely allocating memory in places enabled world

2017-10-02 Thread Eric Dobson
George: I don't see that invariant for java in anything that I search for on Java finalizers. Do you have a reference? In particular java only has one finalizer per object (the finalize method) and across objects the references I found seem to imply that there is no guaranteed order? https://en.wi

Re: [racket-users] Safely allocating memory in places enabled world

2017-10-02 Thread George Neuner
On 10/2/2017 2:52 PM, Matthew Flatt wrote: If we change `ffi/unsafe/alloc` so that a custodian shutdown runs all deallocators, that would work in many cases. It would create a problem, however, if there are objects to deallocate where the deallocation function references other objects that thems

Re: [racket-users] Safely allocating memory in places enabled world

2017-10-02 Thread Matthew Flatt
At Sat, 30 Sep 2017 09:45:02 -0700, Eric Dobson wrote: > I'm trying to write some racket code which interfaces with a foreign > library and provides a safe interface. Some of the functions I'm calling > allocate memory and need to have this explicitly freed by the caller. The > 'allocator' binding

[racket-users] Safely allocating memory in places enabled world

2017-09-30 Thread Eric Dobson
I'm trying to write some racket code which interfaces with a foreign library and provides a safe interface. Some of the functions I'm calling allocate memory and need to have this explicitly freed by the caller. The 'allocator' binding from ffi/unsafe/alloc seems to solve this problem, but I'm runn