-
Notifications
You must be signed in to change notification settings - Fork 22
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
Added GapFFE type #109
Added GapFFE type #109
Conversation
Codecov Report
@@ Coverage Diff @@
## master #109 +/- ##
==========================================
- Coverage 51.65% 51.62% -0.03%
==========================================
Files 42 42
Lines 2536 2549 +13
==========================================
+ Hits 1310 1316 +6
- Misses 1226 1233 +7
|
JuliaInterface/src/gap_macros.c
Outdated
@@ -1,13 +1,14 @@ | |||
#include "libgap-api.h" | |||
|
|||
jl_module_t* get_module_from_string(char*); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, doesn't this PR remove get_module_from_string ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it just moves it all the way to the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but then why is this decl needed, considering that the function implementation now is moved to before the #include "gap_macros.c"
?
JuliaInterface/src/JuliaInterface.c
Outdated
} | ||
|
||
Obj Func_InitializeGAPFFEType(){ | ||
JULIA_GAPFFE_type = (jl_datatype_t*)jl_new_datatype(jl_symbol("GapFFE"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why that cast for the return value? It's not needed, is it?
JuliaInterface/src/JuliaInterface.c
Outdated
jl_emptysvec, | ||
jl_svec(1,jl_symbol("ptr")), | ||
jl_svec(1,jl_voidpointer_type), | ||
0,0,1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though some more about this, and I now think it would be better to create a primitive type instead, using jl_new_primitivetype
-- because what you are stuffing into instances of this type are bits which do not form valid jl_value_t
pointers, but rather are pure bits.
So roughly this:
jl_value_t *name = (jl_value_t*)jl_symbol("GapFFE");
jl_module_t *module = get_module_from_string("GAP");
JULIA_GAPFFE_type = jl_new_primitivetype(name, module, jl_any_type, jl_emptysvec, 8 * sizeof(Obj));
jl_set_const(module, name, JULIA_GAPFFE_type);
I adressed all the changes, and made GAPFFE a primitve type. |
JuliaInterface/src/gap_macros.c
Outdated
@@ -1,13 +1,14 @@ | |||
#include "libgap-api.h" | |||
|
|||
jl_module_t* get_module_from_string(char*); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but then why is this decl needed, considering that the function implementation now is moved to before the #include "gap_macros.c"
?
bbecfe1
to
1c3e24d
Compare
Currently, this causes me severe trouble in Julia, so WIP