Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support external managed memory #494

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

TimWhiting
Copy link
Collaborator

@TimWhiting TimWhiting commented Apr 11, 2024

I've been thinking a bit about automated generation of C wrappers (along the lines of a port of Dart's ffigen), but of course first we need a way of managing external ffi resources in Koka. After searching in kklib for a bit, I found the kk_cptr* functions which don't currently have a corresponding Koka api. Here is an initial Koka api for these functions, allowing us to manage allocated C memory completely from Koka.

@TimWhiting TimWhiting marked this pull request as ready for review April 11, 2024 21:38
@TimWhiting TimWhiting marked this pull request as draft May 3, 2024 01:45
@TimWhiting
Copy link
Collaborator Author

Marking this as draft: I've since made some updates here, which I need to migrate back to this PR: https://github.com/koka-community/std/blob/main/std/cextern.kk

@TimWhiting TimWhiting marked this pull request as ready for review May 11, 2024 14:34
@TimWhiting
Copy link
Collaborator Author

By the way, I have a version of the libuv branch, which uses this api, and automatically generated ffi bindings (adapted from dart's ffigen). This allows us to write almost all of the external binding code in koka.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant