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

Some constant pool fixes and enhancements #1709

Merged
merged 4 commits into from
Oct 18, 2023
Merged

Some constant pool fixes and enhancements #1709

merged 4 commits into from
Oct 18, 2023

Conversation

kddnewton
Copy link
Collaborator

  • The constant pool didn't have the concept of a constant string like pm_string_t, meaning it allocated memory even if the value was known at compile time. This has been fixed.
  • When ... is present in a method definition, you can use * and & to forward subsets of all of the parameters. This has been fixed.
  • I changed the way the Debug module worked when comparing locals in the locals test. This makes it much more obvious where we need anonymous locals to handle specific values.

static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_OWNED = 1;

// A constant constant is known at compile time.
static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_CONSTANT = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Would an enum work here? Or C doesn't like the pm_constant_pool_bucket_type_t type: 2; below with an enum type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe bit fields can only be unsigned ints

Copy link
Member

Choose a reason for hiding this comment

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

It seems to work fine: #1713

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

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

Nice!

@kddnewton kddnewton merged commit 49eae29 into main Oct 18, 2023
46 checks passed
@kddnewton kddnewton deleted the constants branch October 18, 2023 16:08
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