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

Retrieved fields return overly large objects #7

Closed
Seelengrab opened this issue Jun 7, 2023 · 0 comments
Closed

Retrieved fields return overly large objects #7

Seelengrab opened this issue Jun 7, 2023 · 0 comments
Labels
feature New feature

Comments

@Seelengrab
Copy link
Owner

Consider this struct:

@bitfield struct Foo
    a:3
    b:4
    c:12
end

Currently, accessing all three fields returns an UInt, which is larger than necessary. There is room for returning the smallest existing type for each field, capable of holding the number of bits. I.e., accessing a or b would return an UInt8, accessing c an UInt16` etc.

Alternatively (and much harder), there could be room for returning an UInt3/UInt4/UInt12 type. The issue with that is that julia doesn't have this, and I'd rather not complicate downstream dispatch too much by pulling in an external type. For the same reason, dynamically generating these UIntx types and caching them for future declarations is not an option.

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

No branches or pull requests

1 participant