Skip to content

Get referenced-package size - unwrap reference in do_size_of#288

Merged
IsaacWoods merged 1 commit into
rust-osdev:mainfrom
martin-hughes:issue-282-unwrap-refs
May 9, 2026
Merged

Get referenced-package size - unwrap reference in do_size_of#288
IsaacWoods merged 1 commit into
rust-osdev:mainfrom
martin-hughes:issue-282-unwrap-refs

Conversation

@martin-hughes
Copy link
Copy Markdown
Contributor

Pretty much what it says in the title. Closes #282

I didn't do anything fancy like I thought I might do, just a simple fix here.

Comment thread tests/package_sizeof.asl Outdated
Method (MAIN, 0, NotSerialized) {
Local0 = Sizeof (FOO) // Should be 3
Local1 = Sizeof (FOO[0]) // Should be 1. This was the failing line.
Return ((Local0 + Local1) - 4)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As booleans are just integers in AML, does something like Return (!((Local0 != 3) || (Local1 != 1))) work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great plan that I should have thought of! I tried it and generated #294 instead 😆

Actually I think the leading not is not needed. So I've pushed a slightly different version.

@martin-hughes martin-hughes force-pushed the issue-282-unwrap-refs branch from 74b37ed to 41c190c Compare April 30, 2026 11:30
@IsaacWoods
Copy link
Copy Markdown
Member

Thanks!

@IsaacWoods IsaacWoods merged commit 69e1648 into rust-osdev:main May 9, 2026
5 checks passed
@martin-hughes martin-hughes deleted the issue-282-unwrap-refs branch May 12, 2026 08:10
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.

SizeOf on a reference to a package doesn't work

2 participants