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

About the predefined STATUS_MASK macro #19

Open
m-joon-ixix opened this issue Apr 20, 2024 · 1 comment
Open

About the predefined STATUS_MASK macro #19

m-joon-ixix opened this issue Apr 20, 2024 · 1 comment
Labels
solved Question solved

Comments

@m-joon-ixix
Copy link

There exists a pre-defined macro as below, on the given memmgr.c file.

#define STATUS_MASK        ((TYPE)(0x7))               ///< mask to retrieve flags from header/footer

Shouldn't this be 0x1, not 0x7?

@ddony8128
Copy link

Block size should be a multiple of 32 so that the last 4 degrees of size is 0000 as a binary number.

If the status is free: the last 4 degree of header/footer -> 0000
If the status is allocated: the last 4 degree of header/footer -> 0001

So it's no matter to set STATUS_MASK as 1111, 0111, 0011, or 0001. ( respectively equal to 0xf, 0x7, 0x3, 0x1)

@kwonsw055 kwonsw055 added the solved Question solved label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved Question solved
Development

No branches or pull requests

3 participants