-
Notifications
You must be signed in to change notification settings - Fork 29
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
Skip type and roundtrip tests for function types #85
base: master
Are you sure you want to change the base?
Conversation
Function types can mean pointers in Rust, but in C they are not interchangeable. This causes jemallocator to fail its test.
@valtog thanks for the PR, what do you mean that they are not interchangeable ? Could you describe which problem does this solve ? |
@gnzlbg Function pointers are like pointers (with some exception), so you can do struct {
void* (*f)(int a);
}; but function types are not: this doesn't compile (because C is not object-oriented) struct {
void* (f)(int a);
}; Likewise, this code generated by ctest typedef struct {
unsigned char c;
extent_alloc_t v;
} type; with typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *,
bool *, unsigned); doesn't compile. You might think of converting them to function pointers. But we don't even need to test function pointers, because it doesn't make sense to allocate or align them. I want to fix this because I see jemallocator is stuck with an outdated version partly because of it (gnzlbg/jemallocator#130). I'm happy to tackle any other blocker for that PR. |
I'm not sure how this will fix that. When parsing a struct containing a function type in the jemalloc crate, we just see a I think that the right fix for this is to add a |
(Never mind)
I've tested this with the
I was proposing to remove tests for both.
Well I'm fine with that too. |
On second thought, we don't need |
Hi valtog, I’ll take a deep look at this tomorrow and will try to get
jemallocator working again.
|
Function types can mean pointers in Rust, but in C they are not interchangeable. This causes jemallocator to fail its test.