Commit Graph

80 Commits

Author SHA1 Message Date
b6173e2b67
LinkedList: Return Option instead of ENONE if no value 2022-12-08 16:09:04 +01:00
406af68a54
Result: Use Option as backend 2022-12-08 16:08:18 +01:00
b58eba63f1
Add a new Option class which behaves like Result, but has no error number, just a value or no value 2022-12-08 16:08:02 +01:00
6cee208e62
Kernel: Enable -Wsign-conversion
All checks were successful
continuous-integration/drone/push Build is passing
For real this time, turns out me, being dumb, added it to Luna instead of the kernel.
2022-12-08 15:09:32 +01:00
1d5d1daa57
Add scope guards 2022-12-08 14:56:11 +01:00
6de7753b4c
Add malloc wrappers
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-07 18:17:49 +01:00
757cee4693 Add accessors for when you're sure a linked list is not empty 2022-12-07 16:11:59 +00:00
8da5521273 Add a Stack convenience class 2022-12-07 16:11:59 +00:00
f65ed465c4 Bitmap: Fix crash by attempting to memset -1 bits (UINT64_MAX) 2022-12-07 16:11:59 +00:00
d3458f2f0f Bitmap: short circuit on 0-byte clears 2022-12-07 16:11:59 +00:00
4fdd1d57f5 Make build-debug.sh also add debug symbols to luna 2022-12-07 16:11:59 +00:00
287c4ab060 Run clang-format 2022-12-07 16:11:59 +00:00
986aa01948
size_t -> usize
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-07 17:06:29 +01:00
beab3454b5
kernel: Enable -Wsign-conversion and -Wcast-align
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-07 11:47:46 +01:00
1badc40a4a
Run include-what-you-use everywhere 2022-12-07 11:40:02 +01:00
ee276a3a35
Add the nodiscard attribute to make and make_array
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-07 11:01:45 +01:00
8598b1e8fc
Replace the _noreturn macro with the C++ native attribute [[noreturn]]
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-06 19:40:35 +01:00
39b310b6b9
Make alignment a template parameter to help the compiler optimize
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-06 19:27:58 +01:00
b5c6ae253d
Make LinkedList a lot better
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-06 18:41:35 +01:00
d8f75f1d3c
LinkedList: Add an append_after() method
Can be used to append an item after another one instead of at the end of the list.
With doubly linked lists, this is extremely easy to achieve (O(1)).
2022-12-06 18:25:08 +01:00
146da13e43
LinkedList: Make sure to explicitly mark the first node's next and last nodes as nullptr 2022-12-06 18:23:19 +01:00
07e6ebd3cc
LinkedList: Fix nonnull_or_error 2022-12-06 18:22:45 +01:00
87fb195202
Add DoublyLinkedList data structure
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-06 17:37:43 +01:00
dd29156c85
Alloc: make() now takes variadic arguments, to forward to the constructor 2022-12-06 17:36:20 +01:00
eef74e2897
Add a generic error code (ENONE) 2022-12-06 17:35:38 +01:00
a021e7a309
Move make and destroy to luna
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-06 16:41:22 +01:00
1fa99f4f64
Make {add,sub,mul}_will_overflow more compiler-independent
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-06 15:53:06 +01:00
26b44e651d
Change safe_{sub,add,mul} so they perform the operation only once
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-06 15:47:59 +01:00
e91c04b1d1
luna: Introduce safe arithmetic operations, which return an error if an operation would overflow 2022-12-06 15:40:18 +01:00
1e3706ac01
Make ARCH_PAGE_SIZE and ARCH_TIMER_FREQ known at compile-time 2022-12-05 16:36:41 +01:00
7cc139c3f7
Make expect and check use unlikely 2022-12-05 13:35:33 +01:00
792642dd6f
MORE CONST 2022-12-05 12:58:59 +01:00
86a12f301e
Make value_byte a helper 2022-12-05 12:53:16 +01:00
004e13a5f3
Make bitmap methods const if not modifying the bitmap 2022-12-05 12:50:30 +01:00
5aa2d1fa18
Add a Bitmap class to provide common functionality and use that in the MemoryManager 2022-12-04 15:14:07 +01:00
b8239698db
Add descriptions in CMakeLists 2022-12-04 12:47:08 +01:00
c7ab6bc2d3
Reorganize the luna/ directory so that headers aren't in the top level include path 2022-12-04 12:42:43 +01:00
cdbed6970a
Result: Add expect_ variants of value() and release_value() 2022-12-04 12:32:34 +01:00
bb92480aa3
Add a variant of check() that accepts an error message 2022-12-04 12:19:17 +01:00
3740309427 Check for STRINGIZE_VALUE_OF before defining it 2022-12-03 17:18:16 +01:00
1d51935d43 Make Result able to return an error string 2022-11-30 17:10:43 +01:00
fc0779a2f9 Add a SystemError module for errno values :) 2022-11-30 17:10:30 +01:00
f8ed74fda5 Improve unit representation code 2022-11-30 14:41:35 +01:00
f1756e6f58 Add unit formatting 2022-11-30 12:42:11 +01:00
552186ad51 Add string_format and vstring_format 2022-11-30 12:36:21 +01:00
9934719f6b Use a more reliable signed 64-bit type than "long" 2022-11-23 18:05:01 +01:00
3b2dc5db55 PlacementNew.h: Use Types.h 2022-11-23 17:22:16 +01:00
2df0bc4238 Convert one tiny type to Types.h in Format.cpp 2022-11-20 18:31:55 +01:00
459e1ed653 luna/String.h: Convert to Types.h 2022-11-20 18:29:23 +01:00
3815f9aa9f Introduce an offset_ptr function to avoid quirky C pointer arithmetic 2022-11-20 15:12:18 +01:00