aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Adding uint128HexString() and uint256HexString()Sven Gothel2020-11-092-0/+9
|
* Doxygen: Fix macro '__attribute__((x))' handlingSven Gothel2020-11-041-3/+3
|
* Fix uint[192, 256]_t operator==(..): Replace copy & paste erroneous size ↵Sven Gothel2020-11-041-3/+3
| | | | literal with sizeof(data)
* basic_types: User refs > 32-bit values only; Add uint[192, 256]_t; Use ↵Sven Gothel2020-11-031-31/+181
| | | | | | | | | | | | | | | | | | | | | | | | constexpr for uint[128, 192, 256]_t and its bswap(..) basic_types: User refs > 32-bit values only - Avoid mosre costly references size for small payload Add uint[192, 256]_t - New types uint192_t and uint256_t Use constexpr for uint[128, 192, 256]_t and its bswap(..) - constexpr ctor initializes storage with zero - support further compiler optimizations For all X_to_Y(T) conversions - Use inline for 16-64 bit types - Use value for all values <= 32 bits - Use reference for all values > 32 bits - Use constexpr for all own jau:uint[128,192,256]_t For all put_uint*(..) - Use value for all values <= 32 bits - Use reference for all values > 32 bits
* basic_algos: Add template class call_on_release: allows the user to pass a ↵Sven Gothel2020-10-271-0/+33
| | | | function to be called at destruction of this instance
* helper_jni: Add convert_instance_to_jobject<T>(..)v0.2.4Sven Gothel2020-10-251-0/+17
|
* cmake: Expose different instrumentation (-fsanitize=) modulesv0.2.3Sven Gothel2020-10-212-3/+14
|
* cow_[vector, array]: Fix move assignment: drop const; Fix API doc reference: ↵Sven Gothel2020-10-212-27/+27
| | | | Drop <T>
* README bumpSven Gothel2020-10-201-0/+7
|
* Small footprint compromise: Use jau::nsize_t where appropriateSven Gothel2020-10-203-55/+61
| | | | | This revises commit 8e603953e960eb683c7fa00c9cf9fc39ab890c85 to use the smaller footprint nsize_t.
* ringbuffer: Parameterize Size_type, allowing using e.g. jau::nsize_t for ↵Sven Gothel2020-10-204-96/+102
| | | | | | element count and size semantics. This refines commit 0814f8212ac1ec19fef79d8ed55a162d3d8583f3, supporting less invasize size types like nsize_t.
* ordered_atomic: Add sc_atomic_nsize_t and relaxed_atomic_nsize_t to support ↵Sven Gothel2020-10-201-0/+8
| | | | nsize_t
* basic_types: Introducing nsize_t and snsize_t: Natural 'size_t' and ↵Sven Gothel2020-10-201-0/+36
| | | | | | | | | 'ssize_t' alternatives using * int as its natural sized type The leading 'n' stands for natural. This is a compromise to indicate intend, but to avoid handling a multiple sized 'size_t' footprint where not desired.
* build.sh: Release ..Sven Gothel2020-10-201-2/+2
|
* build.sh: Just use DEBUG, not INSTRUMENTATION for local build + testSven Gothel2020-10-201-2/+2
|
* g++ 8.3 -Warray-bounds triggered even on memcpy, mark as no-errorSven Gothel2020-10-201-1/+2
|
* cmake: Add warning (=error): -Wshadow -Wtype-limits -Wsign-compareSven Gothel2020-10-201-1/+4
|
* Use -Wshadow: Shadowing (or local scope override) often causing sloppy bugs, ↵Sven Gothel2020-10-205-24/+24
| | | | avoid.
* Normalize: Use size_t where appropriateSven Gothel2020-10-204-13/+15
|
* basic_types: [int64_t -> uint64_t] getCurrentMilliseconds()Sven Gothel2020-10-202-3/+3
|
* ringbuffer: Normalize using size_t instead of int for element count and size ↵Sven Gothel2020-10-204-144/+174
| | | | semantics.
* ordered_atomic: Add size_t typedef variants: sc_atomic_size_t and ↵Sven Gothel2020-10-201-0/+6
| | | | relaxed_atomic_size_t
* cmake: Drop all sub-folder CXX settings. Use root CMakeLists.txt global ↵Sven Gothel2020-10-203-40/+4
| | | | settings for all, avoiding confusion.
* cow_[vector|array]::put() API doc fixSven Gothel2020-10-192-2/+8
|
* debug: [get|print]_backtrace(..): Add 'skip_anon_frames' arg to suppress ↵Sven Gothel2020-10-193-15/+27
| | | | adding frames w/o proc-name
* function_def: Fix NullInvocationFunc template declaration and clone ↵v0.2.2Sven Gothel2020-10-191-14/+10
| | | | override; Also use shared_ptr<T>(T) ctor only once ;-)
* Add cow_array (similar to cow_vector), but with very limited cow write ops ↵Sven Gothel2020-10-191-0/+431
| | | | and hence limited use
* cow_vector: Add put(size_t i, const Value_type &x) and put(size_t i, ↵Sven Gothel2020-10-191-0/+43
| | | | Value_type &&x), a thread safe method to replace Value_type
* cow_vector: fix at(size_t), add: empty(), move-assignmentSven Gothel2020-10-191-19/+20
| | | | | | | | | Fix - at(size_t): remove noexcept as bounds check throws exception Add - empty() - move-assignment
* cow_vectore::set_store(): Fix API doc: Replace get_snapshot() with copy_store()Sven Gothel2020-10-181-1/+1
|
* README: Bump 0.2.1v0.2.1Sven Gothel2020-10-181-1/+1
|
* JavaUplink/JavaGlobalObj: Test on shared_ptr<>.use_count()==0 as well, ↵Sven Gothel2020-10-182-2/+15
| | | | | | covering concurrent dtor (empty shared_ptr case) JavaUplink also receives a dedicate setJavaObject() w/o arguments to reset the share_ptr, in an explicit manner.
* Fix cow_vector's custom mutable write operation, use: get_write_mutex(), ↵Sven Gothel2020-10-181-13/+57
| | | | | | | | | | | | | | copy_store() and set_store(..) Earlier we abused get_snapshot() for the custom write operation, leading the read-operations using the same snapshot ending in a mutated vector -> BUG. CoW write operations always need to operate on an actual copy of the vector, like push_back() and then replace the store_ref at the end. Hence added copy_store() to return a copy and refined set_store(..) as a move operator requiring std::move(..) to avoid a copy when replacing the store_ref.
* Build: Separate GCC sanitize flags from DEBUG=ON, enable via ↵v0.2.0Sven Gothel2020-10-183-4/+21
| | | | INSTRUMENTATION=ON (tag 0.2.0)
* sc_atomic_critical: Enable API doc ..Sven Gothel2020-10-181-1/+1
|
* cow_write: Add CoW vector implementation, exposing lock-free read operations ↵Sven Gothel2020-10-181-13/+425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | using SC-DRF atomic synchronization. See API doc for details. First bring-up test w/ direct_bt using DEBUG leak and sanitizer successful. Further testing ongoing, hence patched might followup - or not. So far the goals has been reached: - utilizing jau::sc_atomic_critical to synchronize with read operations - utilizing a recursive write mutex to lock all write operations only - underlying store is a shared_ptr<vector<T>>, which gets replaced on write operations -> CoW - same shared_ptr<vector<T>> can be used as snapshot (get_snapshot()) w/o additional costs, e.g for read operations or even write operations. Since write mutex is exposed, using set_store(snapshot) allows user to implement more complex mutations. This is beingn used by direct_bt at one point. - adding convenient push_back_unique(..) and erase_matching(..) methods, as well as a for_each_cow(..) template to iterate over the snapshot with consistently defined content.
* ordered_atomic: Add sc_atomic_critical: RAII-style Sequentially Consistent ↵Sven Gothel2020-10-181-0/+35
| | | | (SC) data race free (DRF) critical block
* ordered_atomic: Add boolean variant for SC and Relaxed ordered_atomic: ↵Sven Gothel2020-10-181-0/+6
| | | | sc_atomic_bool and relaxed_atomic_bool
* jni_mem: API formattingSven Gothel2020-10-181-1/+2
|
* GCC: Add -Wcast-align=strict and cleanup -Wformat flags, also add DEBUG ↵Sven Gothel2020-10-171-3/+4
| | | | -fsanitize-address-use-after-scope
* basic_types: Handle unaligned access via compiler magic 'struct ↵Sven Gothel2020-10-172-101/+85
| | | | | | | | | | | | __attribute__((__packed__))' access - much cheaper! Utilizing a no-cost template struct having the __packed__ attribute utilizes the compiler to generate safe load and store operations. This is validated via '-Wcast-align=strict', which verifies safe pointer cast for all platforms on the current compilation host. This also lead to fixing merge_uint128(*) unsafe cast + assignment.
* basic_types: Handle potentially misaligned address of buffer + byte_offset; ↵Sven Gothel2020-10-171-24/+123
| | | | | | | | | | Add [get|put]_uint64(..) variants. w/o handling misaligned address, we will have an undefined behavior. "A pointer to an object or incomplete type may be converted to a pointer to a different object or incomplete type. If the resulting pointer is not correctly aligned for the referenced type, the behavior is undefined." The C Standard, ISO/IEC 9899:2011
* Enable Full Warnings = Error on GCCSven Gothel2020-10-171-1/+1
| | | | | | | -Wall -Wextra -Wformat=2 -Wformat-overflow=2 -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k -Wnull-dereference -Winit-self -Werror Tested with gcc 8 + 10 on 64bit and 32bit
* Compile clean on g++ 8+10 on 64bit and 32bit with full Warnings (=Error)Sven Gothel2020-10-173-10/+10
| | | | | | Full Warnings = Error: -Wall -Wextra -Wformat=2 -Wformat-overflow=2 -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k -Wnull-dereference -Winit-self -Werror
* .gitignore: += *.logSven Gothel2020-10-161-0/+1
|
* CMakeLists.txt: Fix setting CMAKE_CXX_FLAGS based on CMAKE_COMPILER_IS_GNUCC ↵Sven Gothel2020-10-162-23/+29
| | | | | | | | | | | and DEBUG For GCC always enable all Warnings possible, supporting -Werror (Warning == Error). in DEBUG mode enable '-fstack-protector-strong -fstack-check' and all non-thread sanitizer: '-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fsanitize=leak'. Notable: -fsanitize=thread TSAN's lacks ability to properly handle GCC's atomic macros (like helgrind etc), can't check SC-DRF!
* Require cmake >= 3.13 and use LANGUAGES C CXX (JAVA can be specified later on)Sven Gothel2020-10-162-3/+3
|
* environment: Generalize instantiation using 'root_prefix_domain', lower case ↵Sven Gothel2020-10-163-59/+92
| | | | | | | | | | for 'debug', 'debug_jni' and 'verbose' const fields. Since environment is intended to be used for any project, introduce 'root_prefix_domain' as set on the initial environment::get(..) call. Use lower case 'debug' to avoid collision with DEBUG macro, hence use all lower case const fields.
* Eclipse .cproject: Need to add include/jau as source to allow refactoringSven Gothel2020-10-161-0/+1
|
* Add standalone Eclipse CDT project; Fixing one -Wformat-security warning/errorSven Gothel2020-10-166-1/+272
|