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

remove Buf module, now that cstruct is mature #128

Closed
wants to merge 1 commit into from
Closed

remove Buf module, now that cstruct is mature #128

wants to merge 1 commit into from

Conversation

hannesm
Copy link
Member

@hannesm hannesm commented Feb 12, 2017

@dsheets told me when Buf was written, cstruct was not yet in a mature state. There was no performance measurement of buf vs cstruct done.

Since I like less code more, this seemed to be a good excuse to read through ocaml-dns ;)

any opinions /cc @avsm @djs55 @dsheets @yomimono

let marshal ?alloc q =
[q.Packet.id, Packet.marshal (Buf.create ?alloc 4096) q]
let marshal q =
[q.Packet.id, Packet.marshal (Cstruct.create 4096) q]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is ?alloc removed here? Is it no longer necessary for page-aligned allocations in Mirage on Xen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good remark. at the moment (see mirage/mirage-net-xen#17), Mirage on Xen (in mirage-net-xen) copies the frame anyways to (half-page) aligned memory. no need for page aligned on kvm afaik.

this allows us to remove the entire allocation magic from ocaml-dns, and use Cstruct.create instead. I partially started this (by removing ?alloc parameters), but didn't finish (will do so soon). no io-page will be harmed by this change ;)

@hannesm hannesm mentioned this pull request Feb 24, 2017
@hannesm
Copy link
Member Author

hannesm commented Feb 24, 2017

superseeded by #132

@hannesm hannesm closed this Feb 24, 2017
@hannesm hannesm deleted the no-buf branch February 24, 2017 14:35
RyanGibb pushed a commit to RyanGibb/ocaml-dns that referenced this pull request Sep 26, 2022
As discussed in mirage#128, with the exception of bin_prot, camlzip, zlib-xen
and dolog.
RyanGibb pushed a commit to RyanGibb/ocaml-dns that referenced this pull request Sep 26, 2022
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.

None yet

2 participants