* [stdlib] Add PEM Encoding/Decoding Module
* release notes
* Removed some unnecessary macro usages. Fixed memory handling with headers.
* Make end of line a parameter. Internal encode method -> function. Use more tmem. Remove t-functions.
* Update API
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
Co-authored-by: Christoffer Lerno <christoffer.lerno@gmail.com>
* stdlib: optimize math::next_power_of_2 to O(1) using hardware CLZ
- updated DString.reserve to use this
* bit smearing
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* add deprecations to macro slot builtins
* refactor all stdlib uses of now-deprecated EMPTY_MACRO_SLOT; release notes
* update incorrect releasenotes ref to this pr
* remove leftover comments from refactoring
* remove unnecessary `EmptySlot`-like type in countingsort; use private macro directly
* Merge AsciiCharset CT/non-CT Functions
* release notes
* incorporate helpful review feedback
* re-separate 'create_set' and 'contains' but keep 'combine_sets'; update tests
* tabs (annoying IDE)
* Restored old code verbatim for smaller diff. Split combine_sets into easier to macro/function for runtime / macro version, this also allows for more easy type checks.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* Fixed macro hash_vec(vec): it was checking only 8 bytes
* use $sizeof() directly as it is correct now
* Added unit test for vector types
Tests that hashes match for same values and that they don't match
when changing a single bit on any of the vector elements
* Changed hardcoded value for the compiler option
* Release note
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* 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>