-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Make some internal methods accessible publicly #238
Comments
Hi @jay-sridharan, TinySpline is designed in such a way for a purpose. By "hiding" the internals of the structs, all function can rely on data integrity. However, I see your issue, so let's try to solve it.
Regarding the preprocessor definition, feel free to make a pull request. |
Thanks for the response, Marcel! I tried option #1, however because the default visibility is set to hidden, the compiled library does not actually make these symbols accessible. Line 1032 in bcfe9e6
The Line 70 in bcfe9e6
I could of course compile the library from source, but ideally I want to upstream a way for this to be possible just from having the packaged release installed on the system. What do you think of this idea? We can
// tinyspline.h
extern size_t SIZEOF_BSPLINE_IMPL;
extern size_t SIZEOF_DEBOORNET_IMPL;
// tinyspline.c
size_t SIZEOF_BSPLINE_IMPL = sizeof(tsBSplineImpl);
size_t SIZEOF_DEBOORNET_IMPL = sizeof(tsDeBoorNetImpl);
// tinyspline.h
extern int TS_VERSION_MAJOR;
extern int TS_VERSION_MINOR;
extern int TS_VERSION_PATCH;
// tinyspline.c
int TS_VERSION_MAJOR = 0;
int TS_VERSION_MINOR = 7;
int TS_VERSION_PATCH = 0; |
Hi @msteinbeck , just wanted to follow up on this! If this approach seems reasonable, I'm happy to put in a pull request! |
Hi @jay-sridharan,
This seems indeed reasonable. Feel free to create a pull request :). Please keep in mind to add prefixes to the variable names. For instance, |
Hi @msteinbeck I gave this method a shot, but ran into some issues.... I put in #240 which tries a different approach of adding another header file which declares internal methods. This file is added to the release package, but the header file throws a warning when included to alert the user that they probably don't want to be including it. Let me know what you think! |
I figured this is easier on the client code than a |
Hello again!
I am using this library for a real-time motion control application. To this effect, I cannot have any syscalls once the system is operational, as it introduces non-determinism. This includes malloc.
Tinyspline is really close to what I need because memory allocation is well-contained, and I have been able to write most of what I need using pre-allocated buffers. However, there are some things that would be useful to have exposed to make this possible.
What are your thoughts on including these definitions in
tinyspline.h
?I need
ts_int_bspline_eval_woa
becausets_bspline_eval
calls malloc. The struct definitions are useful to have so that I can callsizeof(tsBSplineImpl)
in the calculation for my static memory allocation, and similarly for tsDeBoorNetImplThe text was updated successfully, but these errors were encountered: