Skip to content

Conversation

@santoshmahto7
Copy link
Collaborator

nplb test PosixThreadAttrTest.StackAddrAndSizeAttr was failing due to large stack size allocation, possibly limitation on platform implementation

Bug: 479846471
Change-Id: If502181c9aef3ce889a0309c68f83847a9699058

nplb test `PosixThreadAttrTest.StackAddrAndSizeAttr` was failing
due to large stack size allocation, possibly limitation on platform
implementation

Bug: 479846471
Change-Id: If502181c9aef3ce889a0309c68f83847a9699058
@santoshmahto7 santoshmahto7 requested a review from y4vor February 10, 2026 13:53
@github-actions
Copy link

🤖 Gemini Suggested Commit Message


starboard: Lower NPLB test stack allocation to 1MB

The PosixThreadAttrTest.StackAddrAndSizeAttr NPLB test was failing
on some platforms due to an excessively large 4MB stack allocation.
Reducing the allocated stack size to 1MB resolves these failures
and accommodates platform-specific stack limitations.

Bug: 479846471

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a test failure by reducing the stack allocation size from 4MB to 1MB, which is a reasonable fix for platform-specific allocation limits. The change is correct. I've added one suggestion to improve code readability by defining a constant for megabytes, which helps in avoiding magic numbers and makes the code more maintainable.

Comment on lines 22 to +23

constexpr int kStackSize = 4 * 1024 * 1024;
constexpr int kStackSize = 1 * 1024 * 1024;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve readability and maintainability by avoiding magic numbers, consider defining a constant for a megabyte and using it to define kStackSize. This makes the unit explicit and the code easier to understand.

Suggested change
constexpr int kStackSize = 4 * 1024 * 1024;
constexpr int kStackSize = 1 * 1024 * 1024;
constexpr int kMegaByte = 1024 * 1024;
constexpr int kStackSize = 1 * kMegaByte;
References
  1. A general software engineering best practice, often included in style guides like Google's C++ Style Guide, is to avoid 'magic numbers' and use named constants to improve code readability and maintainability.

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