summaryrefslogtreecommitdiff
path: root/AK/StackInfo.cpp
AgeCommit message (Collapse)Author
2022-07-19AK: Port StackInfo to FreeBSDDaniel Bertalan
This can almost be identical to the Linux version, except that the `pthread_attr_t` object is populated using a call to `pthread_attr_get_np` instead of `pthread_getattr_np`. FreeBSD also needs `pthread_atttr_t` to be initialized using `pthread_attr_init` instead of zero-initialization, but it's the technically correct thing to do on Linux as well.
2022-07-19AK: Do not negate Pthread error codes for `strerror()`Daniel Bertalan
On all systems I've checked, pthread functions return the positive error code directly.
2021-12-12AK: Fix preprocessor OS checkMartin Blicha
Instead of checking __linux__ macro directly, the code should check if this macro is defined. This is already done correctly a couple of lines above. I ran into this when trying to build libjs-test262 on MacOS where I got the following error message error: "__linux__" is not defined, evaluates to 0 [-Werror=undef]
2021-09-12AK+LibCore: Standardize on AK_OS_MACOS instead of __APPLE__Brian Gianforcaro
We use our custom platform definitions in most places, remove the few remaining places we weren't using `AK_OS_MACOS`.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-03-03AK: Fix OOO mistake in StackInfo.cppihsinme
"!=" has higher priority than "=".
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-01-12LibC+Everywhere: Remove open_with_path_length() in favor of open()Andreas Kling
This API was a mostly gratuitous deviation from POSIX that gave up some portability in exchange for avoiding the occasional strlen(). I don't think that was actually achieving anything valuable, so let's just chill out and have the same open() API as everyone else. :^)
2020-12-30AK: Use MacOS pthread_get_stacksize_np to get stack size for StackInfoAndrew Kaster
Seems Rust and OpenJDK both had issues with getting accurate stack size for the main thread with MacOS Maverick and above. Apply a variant of their workarounds. We could probably assume 8MB in all cases just to be safe, as the only user of AK::StackInfo right now is lib JS's heap for determining possible pointer candidates. But, this approach should work if userspace apps start trying to add custom guard pages, as well.
2020-11-22AK: Cleanup missing includes and #ifdef evaluationLenny Maiorani
Problem: - Several files have missing includes. This results in complaints from `clang-tidy`. - `#ifdef` is followed by `#elif <value>` which evaluates to `0`. Solution: - Add missing includes. - Change to `#elif defined(<value>)`.
2020-11-08LibJS+AK: Move cross-platform stack bounds code from JS::Heap to AK::StackInfoLinus Groh
This will be useful for other things than the Heap, maybe even outside of LibJS.