Branch: refs/heads/webkitglib/2.54
Home: https://github.com/WebKit/WebKit
Commit: cc61ff0b6aba13f7dbd5c6a5917179728575d4e7
https://github.com/WebKit/WebKit/commit/cc61ff0b6aba13f7dbd5c6a5917179728575d4e7
Author: Carlos Alberto Lopez Perez <[email protected]>
Date: 2026-08-05 (Wed, 05 Aug 2026)
Changed paths:
M Source/WTF/wtf/StackBounds.h
Log Message:
-----------
Cherry-pick 318534@main (f6bc402b8344).
https://bugs.webkit.org/show_bug.cgi?id=320926
[WTF] Make StackBounds::currentThreadStackBounds() private to Thread
https://bugs.webkit.org/show_bug.cgi?id=320926
Reviewed by Yusuke Suzuki.
On Linux, obtaining the main thread stack bounds can be expensive.
currentThreadStackBoundsInternal() calls pthread_getattr_np(), which may
parse the entire /proc/self/maps file to locate the main thread stack.
Calling it repeatedly can cause performance problems like the one fixed
in 318487@main.
currentThreadStackBounds() is intended to be called during thread
initialization, with the result cached in Thread::m_stack. Other code
should read the cached bounds using Thread::currentSingleton().stack().
Nothing enforced this restriction, which allowed the uncached function
to be used repeatedly. Move currentThreadStackBounds() to the private
section and make Thread a friend, preventing other callers from
accidentally bypassing the cached bounds.
* Source/WTF/wtf/StackBounds.h:
(WTF::StackBounds::currentThreadStackBounds):
Canonical link: https://commits.webkit.org/318534@main
Canonical link: https://commits.webkit.org/317695.53@webkitglib/2.54
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications