Skip to content

Optimize UnaryStruct memory use for when its unused #9

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

Merged
merged 1 commit into from
Feb 1, 2018

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Jan 16, 2018

Having __init__ create a bytearray buffer costs 32 bytes for every UnaryStruct
even when its not used. This makes code size a bit larger but its
shared amongst all instances.

create a bytearray buffer costs 32 bytes for every UnaryStruct
even when its not used. This makes code size a bit larger but its
shared amongst all instances.
@tannewt tannewt requested review from mrmcwethy and a team January 24, 2018 20:25
@tannewt
Copy link
Member Author

tannewt commented Feb 1, 2018

Can someone review this please?

@ladyada
Copy link
Member

ladyada commented Feb 1, 2018

hiya i dont see anything conceptually amiss here, want me to test with some i2c hardware that uses this library?

@tannewt
Copy link
Member Author

tannewt commented Feb 1, 2018

@ladyada I've tested it on my end so its up to you if you want to test before approving.

@ladyada
Copy link
Member

ladyada commented Feb 1, 2018

tested with AMG8833 - works good!

@ladyada ladyada merged commit 0d45dca into adafruit:master Feb 1, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 7, 2018
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

Successfully merging this pull request may close these issues.

2 participants