* Linux: implement signal stacktrace using SA_SIGINFO + sigaltstack
Adds proper signal handlers for SIGSEGV/SIGBUS/SIGILL on Linux,
enables backtraces from signal context, and exits with correct POSIX
signal codes (128+signal). Fixes missing "signal stacktrace" support
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
* defer libc::dlclose(handle);
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
* fix double backtrace on panic
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
* add guards for Linux X86_64
- remove comments
- uncomment MContext_t for Linux AARCH64
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
* fix guards, missed in two places
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
---------
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* Add NetBSD Support
Includes:
- Hints to find non-compatibility libc functions
- Struct and constant definitions for sockets, polling, etc.
- Changes to the linker code to work around some quirks in the NetBSD dynamic linker
- A target triple for netbsd aarch64 so llvm builds/links the compiler properly on this platform
* Updated releasenotes and some compacting
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* ChaCha20 implementation, first pass
* fix bug with clone_slice when length is 0
* final ChaCha20 crypto tidying
* final adjustments; add benchmark
* add guards everywhere else or w/e
* stdlib 'i++' conformity
* release notes & security warning updates
* update tests; cleanup; default counter should be 0 not 1
* remove prints in test file
* add extra unit tests for unaligned buffers
Co-authored-by: Manu Linares <mbarriolinares@gmail.com>
* one final alignment test
* nice contraction of tests w/ some paranoia sprinkled in
* nearly double the efficiency of chacha20's transform
Co-authored-by: Manu Linares <mbarriolinares@gmail.com>
* fix memory leak in test case
* improve one of the unit tests to cover more cases
* greatly simplify chacha20 'transform'
Co-authored-by: Manu Linares <mbarriolinares@gmail.com>
---------
Co-authored-by: Manu Linares <mbarriolinares@gmail.com>
* fix memory leak in string_escape.c3
* add unescape_lenient and tunescape_lenient
* Optimize for the use of the temp allocator.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This feature adds an option from project.json and build options to disable libc unreachable statements in order to be able to implement one for yourself. Useful feature for bare metal developing.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* add join for ThreadPool without destroying the threads
* Make the main Thread block waiting for the worker threads to finish instead of buzy looping and do proper initialization and freeing of all variables.
* Updated test to use `atomic_store` and take into account the maximum queue size of the threadpool.
* - Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
- Return of Thread/Mutex/CondVar `destroy()` is now "@maydiscard" and should be ignored. It will return void in 0.8.0.
- Return of Mutex `unlock()` and `lock()` is now "@maydiscard" and should be ignored. They will return void in 0.8.0.
- Return of ConditionVariable `signal()` `broadcast()` and `wait()` are now "@maydiscard". They will return void in 0.8.0.
- Return of Thread `detatch()` is now "@maydiscard". It will return void in 0.8.0.
- Buffered/UnbufferedChannel, and both ThreadPools have `@maydiscard` on a set of functions. They will retunr void in 0.8.0.
- Pthread bindings correctly return Errno instead of CInt.
- Return of Thread `join()` is now "@maydiscard".
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* Make StderrLogger print file and line if `FULL_LOG`
* Avoid inlining a lot of code by using a macro wrapper. Fix test.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* Doc comment improvements
* update `compression/qoi.c3` to use const enums
* revert sweeping doc comment changes that impacted readability for now
* Some tweaks.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* Add LinkedList Operators and Update Tests
* add linkedlist printing and `@new` macros (single-line init and pool-capable)
* add linkedlist node and reg iterator; comparisons w/ ==
* Fix benchmarks. Drop random access to the linked list using []. Only return a direct array view.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* fix typos in comments and strings
* fix typos in symbols (and some comments/strings)
* fix typos in releasenotes.md
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
- Added optional macro arguments using `macro foo(int x = ...)` which can be checked using `$defined(x)`.
- Supplemental `roundeven` has a normal implementation.
* wip: array reduce and any/all
* wip: continue adding more functional-like array module functions
* wip: documentation and other fixes
* finish unit tests, require INDEX variable in lambdas, ready for first review
* don't worry about iterating by ref (it wasn't passing it that way anyhow)
* update release notes again
* simplify, remove "summary operators" and related tests
* Use more $defined, remove "has_operator". Fix regression in `$defined(var $f = 123)`
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* Add form-feed and vertical tab to` trim` defaults
* add some initial string-based benchmarking
* update to non-const string
* do not account for mem times in bench
* misc bench fixes to repair reporting times; improve trim tests
* ok last one for real..remove (void) casts
* finally, swap to more efficient default whitespace order in `trim`