Skip to content

refactor: remove internal ffi module #310

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

Merged
merged 1 commit into from
Aug 1, 2022
Merged

refactor: remove internal ffi module #310

merged 1 commit into from
Aug 1, 2022

Conversation

molpopgen
Copy link
Member

This PR removes the internal ffi module,
which had been used to wrap the low-level C
types.

It is no longer clear that we have a robust
pattern warranting a trait.
So we are removing the internal trait until
such a pattern becomes clear.

The issues are:

  1. Some C types require malloc to be used properly.
    The table collection is the main example here:
    we need to malloc it so that a tree sequence
    can steal its pointer.
  2. Some uses of some C types require uninitialized
    structures.
    This requirement leads to rust code that looks
    sketchy at first glance.
    This PR refactors that code to leave things
    in either a NonNull or a MaybeUninit as long
    as possible.

@molpopgen molpopgen merged commit bd081db into main Aug 1, 2022
@molpopgen molpopgen deleted the remove_ffi_module branch August 1, 2022 19:18
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