Jackalope / jlib (public) (License: GPLv3 or later) (since 2019-11-18) (hash sha1)
jlib C++ template library
Used to replace std functionality without exception handling.
- data structures
- filesystem routines
- crossplatform threads interface (currently only pthreads implementation)
- thread pool
- crossplatform dynamic memory functions interface (allocate, reallocate, deallocate) with alignment support
- high percision timer routines based on timespec
List of commits:
Subject Hash Author Date (UTC)
jassert release macro was wrong 97964f5cf3485502675b77b4df5b322921355cf7 jp.larry 2019-11-25 20:15:13
darray insert functions without checking for resize 0a168f4fc057f697bec6ad1f90faaaa7977c9537 Your Name 2019-11-25 08:39:45
replaced free with jl::deallocate 1d25f7cfe0a36ce04eeb8a6a08dc9f9eefe5c2df Your Name 2019-11-25 07:28:42
jabort_release and jassert_release macros 71349de13d880a9a13eb7cca9c46d460c30705b2 Your Name 2019-11-25 07:00:50
endianness convertion function fbff0fbb13891f7ad2975e226476cf0b56eabb36 Your Name 2019-11-25 06:06:17
overwise -> otherwise 89d07c9f30aba52e50526b0ecf1ed6eddb791764 Your Name 2019-11-25 06:01:13
init function was incorrect 6c820a36720b41b2efbfcf101bd12eb43f69a91d Your Name 2019-11-25 05:59:05
time struct for time measurements d6e362c72596c97abbd7c6f87c25eca1d3127c46 Your Name 2019-11-25 05:58:50
jassert macro, assert alternative e5b46d371c19ec6608c861c8b93a9963f117ec6d Your Name 2019-11-25 05:43:03
typo 14b869ada95c37bcc75a549cdcedae1b0b2ba76d Your Name 2019-11-25 03:27:12
thread pool cleanup 0b783f47cd02fb118f299784b52209e259646b25 Your Name 2019-11-25 03:23:02
removed nodiscard for optional function 3ba7da3a20d2ef5e8bc70d1ff14b9db973bba0dd Your Name 2019-11-25 03:22:13
rarray allocation fix e192f65d453e4e858bc0c034b5b431591175886d Your Name 2019-11-25 03:20:49
new darray function 41ed65d9c71ba226572b451f487ac381bdcb382d Your Name 2019-11-25 03:20:26
threads wrapper and thread pool moved to jlib e902ab04f388b331f7b0201a01591c52c0fb44a5 Your Name 2019-11-25 02:11:05
sharray implementation 84f563f018049700a9aaa3d9b915cd8e60010d6a Your Name 2019-11-25 02:10:39
removed excess cmake variable 5391e7b7eb08e7aef83e7b3783c3eb405b701f99 Your Name 2019-11-25 02:09:41
max and min functions 9aee2d76ffc74c9ff5e9b10591b4b5a77de8a859 Your Name 2019-11-25 02:09:16
item_call uses call func instead of constructor, so refference or copy can be passed and added conditional removing in darray 4caca92c89f8945a937e9fe6d5c8634ffc6b0af1 Your Name 2019-11-25 02:08:08
sharray work in progress 440da36f73077f6b7eec359d0059d1b1df96b295 Your Name 2019-11-24 21:47:22
Commit 97964f5cf3485502675b77b4df5b322921355cf7 - jassert release macro was wrong
Author: jp.larry
Author date (UTC): 2019-11-25 20:15
Committer name: jp.larry
Committer date (UTC): 2019-11-25 20:15
Parent(s): 0a168f4fc057f697bec6ad1f90faaaa7977c9537
Signer:
Signing key:
Signing status: N
Tree: 33a902c1290eee7c1d241a3b1ae8ff9bf6fa8b7c
File Lines added Lines deleted
include/jlib/assert.h 3 1
include/jlib/rarray.h 13 14
File include/jlib/assert.h changed (mode: 100644) (index 7439112..ad2b47a)
2 2 #include <cstdio> #include <cstdio>
3 3 #include <cstdlib> #include <cstdlib>
4 4
5
5 6 #ifndef SOURCE_PATH_SIZE #ifndef SOURCE_PATH_SIZE
6 7 #error SOURCE_PATH_SIZE must be size of path to project root directory, set macro in compiler options #error SOURCE_PATH_SIZE must be size of path to project root directory, set macro in compiler options
7 8 #endif #endif
 
15 16 #ifndef NDEBUG #ifndef NDEBUG
16 17 #define jassert(Expr, Msg) jassert_release(Expr, Msg) #define jassert(Expr, Msg) jassert_release(Expr, Msg)
17 18 #else #else
18 #define jassert(Expr, Msg) ((void)Expr);
19 #define jassert(Expr, Msg) ((void)(Expr))
19 20 #endif #endif
20 21 namespace jl::details namespace jl::details
21 22 { {
 
... ... namespace jl::details
34 35 abort(msg, expr_str, file, line, func); abort(msg, expr_str, file, line, func);
35 36 } }
36 37 } }
38
File include/jlib/rarray.h changed (mode: 100644) (index b13540c..5001c81)
... ... namespace jl
93 93 * Same as rarray::init_move, but with different second argument * Same as rarray::init_move, but with different second argument
94 94 * *
95 95 * @param[in] p_allocated_mem Pointer to begin of already allocated memory. * @param[in] p_allocated_mem Pointer to begin of already allocated memory.
96 * @param[in] allocated_mem_size Size of allocated memory.
96 * @param[in] allocated_count Size of allocated memory in items count.
97 97 * *
98 98 * @see rarray::init_move * @see rarray::init_move
99 99 */ */
100 void init_move(T *p_allocated_mem, size_t allocated_mem_size)
101 {
102 init_move(p_allocated_mem, const_cast<T*>(reinterpret_cast<const T*>(
103 reinterpret_cast<const uint8_t*>(p_allocated_mem)
104 + allocated_mem_size)));
105 }
100 void init_move(T *p_allocated_mem, size_t allocated_count)
101 { init_move(p_allocated_mem, p_allocated_mem + allocated_count); }
106 102
107 103 /** /**
108 104 * @brief Create rarray with already allocated memory. * @brief Create rarray with already allocated memory.
 
... ... namespace jl
138 134 * @brief Create read-only rarray by pointer to array. * @brief Create read-only rarray by pointer to array.
139 135 * *
140 136 * @param[in] p_begin Pointer to begin of array. * @param[in] p_begin Pointer to begin of array.
141 * @param[in] size Size of array in bytes.
137 * @param[in] count Size of array in items count.
142 138 * *
143 139 * @return read-only rarray * @return read-only rarray
144 140 */ */
145 [[nodiscard]] static rarray<const T> built_const(const T *p_begin, size_t size)
146 {
147 return built_const(p_begin,
148 reinterpret_cast<const T*>(reinterpret_cast<const uint8_t*>(p_begin) + size));
149 }
141 [[nodiscard]] static rarray<const T> built_const(const T *p_begin, size_t count)
142 { return built_const(p_begin, p_begin + count); }
150 143 /** /**
151 144 * @brief Deallocate space, set item count to 0. * @brief Deallocate space, set item count to 0.
152 145 * *
 
... ... namespace jl
209 202 [[nodiscard]] size_t size_allocated() const { return size_t(p_end_allocated - p_begin); } [[nodiscard]] size_t size_allocated() const { return size_t(p_end_allocated - p_begin); }
210 203
211 204 ///@brief Count of items. ///@brief Count of items.
212 [[nodiscard]] size_t count() const { return size_t(end() - begin()); }
205 [[nodiscard]] size_t count() const { return size_t(end() - begin()); }
206 /// @brief Count of items in 32-bit unsigned integer.
207 [[nodiscard]] uint32_t count32() const { return uint32_t(count()); }
208 /// @brief Count of items in 16-bit unsigned integer.
209 [[nodiscard]] uint16_t count16() const { return uint16_t(count()); }
210 /// @brief Count of items in 8-bit unsugned integer.
211 [[nodiscard]] uint8_t count8() const { return uint8_t (count()); }
213 212
214 213 /// @brief Get pointer to an allocated memory. /// @brief Get pointer to an allocated memory.
215 214 [[nodiscard]] T* begin() { return reinterpret_cast<T*>(p_begin); } [[nodiscard]] T* begin() { return reinterpret_cast<T*>(p_begin); }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Jackalope/jlib

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/jlib

Clone this repository using git:
git clone git://git.rocketgit.com/user/Jackalope/jlib

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main