rust-gmp
rust-gmp copied to clipboard
Fixes used by VDF
- Make
Mpz
#[repr(transparent)]
- Add
#[inline]
attributes - Delete trailing whitespace
for example what's the benefit here of inlining
It allows cross-crate inlining without LTO.
IIUC, by default, an rlib will contain an optimized representation of the source code for generic functions but will only contain the compiled form of non-generic functions. The source representation is required for cross-crate inlining.
The #[inline]
attribute tells the compiler to include the source representation in the rlib, and hints to LLVM that it should inline these function calls.
Since all of the annotated functions are small, inlining seems reasonable, especially cross crate.
Apologies for the drive-by comment.
for example what's the benefit here of inlining
It allows cross-crate inlining without LTO.
IIUC, by default, an rlib will contain an optimized representation of the source code for generic functions but will only contain the compiled form of non-generic functions. The source representation is required for cross-crate inlining.
The
#[inline]
attribute tells the compiler to include the source representation in the rlib, and hints to LLVM that it should inline these function calls.Since all of the annotated functions are small, inlining seems reasonable, especially cross crate.
Apologies for the drive-by comment.
Mad, thanks for the info man.