Skip to content

Add RAM-based configurable thread stack size#227

Open
tnidigan wants to merge 1 commit intoqualcomm:mainfrom
tnidigan:ram-based-thread-stack-size
Open

Add RAM-based configurable thread stack size#227
tnidigan wants to merge 1 commit intoqualcomm:mainfrom
tnidigan:ram-based-thread-stack-size

Conversation

@tnidigan
Copy link
Copy Markdown
Contributor

This PR implements dynamic thread stack size based on system RAM.

Changes

  • Reads system RAM from /proc/meminfo
  • Configures stack size: <1GB→2MB, <4GB→4MB, <8GB→8MB, ≥8GB→16MB
  • Uses pthread for custom stack sizes

int8_t isCoreThread;
};

ThreadArgs* args = new ThreadArgs{this, isCoreThread};

Check failure

Code scanning / CodeQL

Incorrect allocation-error handling High

This allocation cannot throw.
This catch block
is unnecessary.
thNode->usePthread = 1;
} else {
// Use default std::thread creation
thNode->th = new std::thread(threadStartRoutine, isCoreThread);

Check failure

Code scanning / CodeQL

Incorrect allocation-error handling High

This allocation cannot throw.
This catch block
is unnecessary.
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