Skip to content

Comments

Fix: range handling#16

Open
dragonmux wants to merge 2 commits intoehntoo:masterfrom
dragonmux:fix/range-handling
Open

Fix: range handling#16
dragonmux wants to merge 2 commits intoehntoo:masterfrom
dragonmux:fix/range-handling

Conversation

@dragonmux
Copy link

@dragonmux dragonmux commented Nov 27, 2023

This PR addresses an issue that cropped up while using the plugin with the ESP32-C3's SVD, which extensively relies on dimension ranges.

The plugin would crash and fail to read the SVD when it hit one of the dim node range specifications due to trying to pass a string as the argument to range(). This is the resulting fix after digging into why, and a small optimisation to this code by dropping the forced list() expansions which sped loading up a fair bit, while reducing memory utilisation.

We've also added some type annotations which helped us in diagnosing the types issue and what exactly was going on.

…d to rnage() in expand_dim()

This is done along side fixing the grossly pessimising `list()` calls on the resulting range objects in the index handling
as this makes for a huge allocation and a lot of churn when dealing with SVDs with large ranges specified
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.

1 participant