mbox icon indicating copy to clipboard operation
mbox copied to clipboard

Questions

Open madsmtm opened this issue 4 years ago • 2 comments

Hey, I've opened a few PRs against this repo because we intend to use it in the future in objc (see https://github.com/SSheldon/rust-objc/pull/72), and in my fork of that project.

So, I have a few questions regarding the code:

  • Have you considered whether the unstable #[may_dangle] is appropriate for MBox?
  • It is generally a good idea to add #[inline] on smaller functions, especially on forwarding implementations, have you considered this?
  • The file structure is a bit unorthodox compared to most rust projects (mostly that test functions live outside a #[cfg(test)] mod tests) - would you be open to PRs refactoring this?

And a few regarding the project itself:

  • Would you be open to relicensing under a dual MIT / Apache 2.0 license?
  • This crate is currently lacking the high quality documentation that c_vec has, especially regarding examples; maybe consider making some of the tests as documentation examples?
  • If you want more widespread adoption (which I generally think this crate deserves), maybe consider opening a PR against sdl2 and hyperscan.

madsmtm avatar Nov 23 '21 22:11 madsmtm

And do you know if it will be possible, when the relevant features stabilize, to create an Allocator such that MBox could just be type MBox<T> = Box<T, MallocAllocator>?

madsmtm avatar Nov 23 '21 22:11 madsmtm

Regarding inlining, see https://std-dev-guide.rust-lang.org/code-considerations/performance/inline.html and https://nnethercote.github.io/perf-book/inlining.html

madsmtm avatar Jun 19 '22 23:06 madsmtm