Skip to content
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

Support isbits Union #2

Open
mbravenboer opened this issue Sep 7, 2018 · 1 comment
Open

Support isbits Union #2

mbravenboer opened this issue Sep 7, 2018 · 1 comment
Assignees

Comments

@mbravenboer
Copy link
Contributor

Unions of isbits types are not directly isbits in Julia 0.7/1.0 so they need more specific support if we want to use them with Blobs.jl.

References:

I expect Blobs will need to do something like this:

Julia now includes an optimization wherein "isbits Union" fields in types (mutable struct, struct, etc.) will be stored inline. This is accomplished by determining the "inline size" of the Union type (e.g. Union{UInt8, Int16} will have a size of 16 bytes, which represents the size needed of the largest Union type Int16), and in addition, allocating an extra "type tag byte" (UInt8), whose value signals the type of the actual value stored inline of the "Union bytes".

Given that the optimization is specific to fields and that the tag is not part of the Union itself, I'm not quite sure if copying can be avoided though when the union is used?

@PallHaraldsson
Copy link

Bump.

FYI: Julia's PR 32448 is closed in Julia 1.4, which is now released. If I understand correctly it impacts you here.

Despite NEWS saying it's a "language" feature, my understanding it's not, as in a syntax feature. It's however a implementation detail, impacting none who only use Julia (except for reinterpret), unless they use packages such as yours that do low-level stuff.

I'm not sure what needs to be done here. Something and then limit to Julia 1.4+ (and drop REQUIRE). And before/until such a change, limit last release to supporting at most 1.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants