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

clarification: sizeof(data) or sizeof(ThreadData), pg. 70 & 71 #8

Open
profnandaa opened this issue May 2, 2023 · 3 comments
Open

Comments

@profnandaa
Copy link
Contributor

profnandaa commented May 2, 2023

On page 70 and 71:

image

Though in the code sample, you are using sizeof(ThreadData):

information = sizeof(ThreadData);

As much as both are 8, it could be misleading since the pointer size will stay the same regardless of struct change.

@zodiacon
Copy link
Owner

zodiacon commented May 2, 2023

sizeof(data) is incorrect because data is a pointer, whose size is fixed (4 or 8 bytes). sizeof(*data) would be correct, but I think sizeof(ThreadData) is clearer, since this is the structure that is used.

@profnandaa profnandaa changed the title chap.4: clarification: sizeof(data) or sizeof(ThreadData), pg. 70 & 71 clarification: sizeof(data) or sizeof(ThreadData), pg. 70 & 71 May 15, 2023
@profnandaa
Copy link
Contributor Author

Reminder on this, still there in the latest ed.

@zodiacon
Copy link
Owner

fixing

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

No branches or pull requests

2 participants