Erk- / genfut

Generate bindings for Futhark
ISC License
37 stars 10 forks source link

Add FutharkContext::free. #19

Closed porcuquine closed 4 years ago

porcuquine commented 4 years ago

Closes #15 .

I tried to implement Drop for FutharkContext as suggested in the issue. However, removing the Copy trait (as required) led to compilation errors in the Array_::from_vec methods. I am not certain there is no way around this, but I was not able to figure anything out after some rooting around.

Consumers for whom an RAII-based cleanup makes sense can use free in an appropriate Drop implementation. In the specific case of neptune-triton, we only ever allocate a single FutharkContext per device (per process) — which is another strategy to avoid leaking contexts.

Erk- commented 4 years ago

I think it should be possible to implement drop for it, but I need to have a look at myself when I get home from holiday later this week.

Erk- commented 4 years ago

Superseded by #20