Daniel Ridge <[EMAIL PROTECTED]> writes:
> What I would really like is the way in guile to create a string or a
> u8vector whose C data will not ever be free()ed by the garbage
> collector -- but I may be a user community of 1 on this point. What
> about relaxing must_free to accept a NULL pointer? If we did this, I
> could just whack the pointer in the guardian and the rest of the GC
> process would proceed normally.
>
> Is there any enthusiasm (for/against) in the user community for
> including mmap in libguile?
Yes from me; it sounds interesting and useful.
The architecture that springs to my mind for this is
- an mmap SMOB, which conceptually owns the mapped memory, and whose
free function would do the unmapping
- a shared array or uniform vector, which shares the SMOB's memory and
makes it available for manipulation through the array/vector API.
It looks like scm_t_array (in CVS HEAD) has the right structure
already to allow it to reference an arbitrary underlying object; the
details will need some hacking.
If possible, it would be nicer to implement this so that the mmap
support could be split into a separate library. (Or is in a separate
library to begin with.)
Regards,
Neil
_______________________________________________
Guile-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-user