8000 4.1.x increase cpx stack update frozen by dhalbert · Pull Request #2407 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

4.1.x increase cpx stack update frozen #2407

New issue

Have a question about this project? Sign up for a free GitHub accou 8000 nt 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

Conversation

dhalbert
Copy link
Collaborator
  • Increase stack size on CPX builds to accommodate additional stack depth needed for from adafruit_circuitplayground import cp. Must be tested from code.py, which adds additional stack depth over testing from REPL.
  • Update frozen libraries, including most importantly updated CP library.

@dhalbert dhalbert requested a review from kattni December 18, 2019 14:50
kattni
kattni previously approved these changes Dec 18, 2019
Copy link
@kattni kattni 8000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully tested build on CPX with every available example in the Circuit Playground library repo.

Copy link
@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested again successfully with change. Thanks for putting this together!

@dhalbert dhalbert merged commit 483a6a9 into adafruit:4.1.x Dec 18, 2019
@dhalbert dhalbert deleted the 4.1.x-increase-cpx-stack-update-frozen branch December 18, 2019 17:41
tyomitch pushed a commit to tyomitch/circuitpython that referenced this pull request Apr 28, 2021
This commit adds the errno attribute to exceptions, so code can retrieve
errno codes from an OSError using exc.errno.

The implementation here simply lets `errno` (and the existing `value`)
attributes work on any exception instance (they both alias args[0]).  This
is for efficiency and to keep code size down.  The pros and cons of this
are:

Pros:
- more compatible with CPython, less difference to document and learn
- OSError().errno will correctly return None, whereas the current way of
  doing it via OSError().args[0] will raise an IndexError
- it reduces code size on most bare-metal ports (because they already have
  the errno qstr)
- for Python code that uses exc.errno the generated bytecode is 2 bytes
  smaller and more efficient to execute (compared with exc.args[0]); so
  bytecode loaded to RAM saves 2 bytes RAM for each use of this attribute,
  and bytecode that is frozen saves 2 bytes flash/ROM for each use
- it's easier/shorter to type, and saves 2 bytes of space in .py files that
  use it (for each use)

Cons:
- increases code size by 4-8 bytes on minimal ports that don't already have
  the `errno` qstr
- all exceptions now have .errno and .value attributes (a cpydiff test is
  added to address this)

See also adafruit#2407.

Signed-off-by: Damien George <damien@micropython.org>
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.

4 participants
0