I took the FFI about as far as I'm going to take it for now, which is farther than it was in v2. Specifically:
If the extern decl specifies cstring for a parameter, I automatically convert from c4m_utf8_t * (i.e., pass in the data pointer).
For return values marked as cstring, I wrap them in a c4m_utf8_t after return.
the holds parameter in is honored; the GC won't collect objects where this has been marked, until c4m_gc_remove_hold is called on the object.
The things I'm deferring still:
Handling varargs calls (not going to do this until I do keyword parameters).
Implementing the allocs parameter. It'd be easy to put allocs in an object wrapper that has a finalizer attached to it, but I need to think about how people should specify what deallocator to use, etc. This isn't important, so I'm not in a hurry on it.
I took the FFI about as far as I'm going to take it for now, which is farther than it was in v2. Specifically:
extern
decl specifiescstring
for a parameter, I automatically convert from c4m_utf8_t * (i.e., pass in the data pointer).cstring
, I wrap them in a c4m_utf8_t after return.holds
parameter in is honored; the GC won't collect objects where this has been marked, untilc4m_gc_remove_hold
is called on the object.The things I'm deferring still:
allocs
parameter. It'd be easy to put allocs in an object wrapper that has a finalizer attached to it, but I need to think about how people should specify what deallocator to use, etc. This isn't important, so I'm not in a hurry on it.