-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the way we do Int64 conversion to/from GAP
Previously, any Int64 too big to fit into a GAP immediate integer was put into a T_JULIA wrapper when passed to GAP, and unwrapped later. At the same time, `julia_to_gap` relied completely (and incorrectly) on the C kernel functions `julia_gap` and `gap_julia` to take care of *all* Int64 values. The result was that passing such an integer as argument to a GAP function did not work, not even if one explicitly used `julia_to_gap`. To fix this we teach the C kernel function `gap_julia` to convert "large" Int64 values to GAP big integers; this ensures that the many adapter functions we install for Int64 arguments work. This means that we violate the principle of roundtrip type fidelity (Int64 -> GAP large int -> MPtr), but that is a very minor concern. For really efficient conversions of e.g. Array{Int64,1} to GAP plists, we need dedicated conversion functions which directly copy over bits. These can be added transparently in the future. Finally, we add some minor optimization to julia_to_gap for UInt64, Int128, UInt128
- Loading branch information
Showing
6 changed files
with
43 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters