-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
inline function swap_store
in blosc2.h
#500
Comments
Actually, you already have such functions: c-blosc2/blosc/blosc-private.h Lines 136 to 150 in 65a1a30
|
You even have a similar c-blosc2/blosc/blosc-private.h Lines 49 to 87 in 65a1a30
|
IIRC we made this in order to avoid replicating the code in codecs, which do not have access to the blosc2 internals. See e.g. 8359e6d |
I see. How about moving that code to plugins/plugin_utils.h? |
+1 |
Also,
I plan on adding specialised functions for those types only (and maybe 16-bits integers just in case). |
Actually, (some) codecs do access For example, while compiling c-blosc2/plugins/codecs/zfp/blosc2-zfp.c Lines 8 to 14 in 65a1a30
What do you mean exactly by “codecs [...] do not have access to the blosc2 internals”? |
I don't remember exactly how things went, but probably we've made Now that I look into the code, a possibility is to move these functions to |
So, it would be part of the API after all. I will move/merge everything from |
These two functions are (almost) identical:
These functions are really strange, it feels like they were written as an example not to follow:
I'll see if we can get rid of them, and stick to functions specialised for 2, 4 or 8 bytes. |
Any progress on this one? |
I can't recall why this issue is stalled. I guess I'm not entirely certain how to fix this. Ideally, these functions should be removed from the API. |
Describe the bug
Why is the inline function
swap_store
part of the API?It is mostly used for
int32_t
andint64_t
. In that case, calls tomalloc
andmemcpy
are overkill. Just use:Actually, you should use compiler intrinsics if they exist:
To Reproduce
c-blosc2/include/blosc2.h
Lines 2121 to 2127 in 65a1a30
Expected behavior
Remove from the API.
Rewrite using compiler intrinsics and fall back to the above piece of code.
Additional context
See xxHash implementation:
The text was updated successfully, but these errors were encountered: