Commit Graph
100 Commits
Author SHA1 Message Date
abdelrahman a546a09565 Split commander windows and posix implementations 2024-10-05 22:25:21 +01:00
abdelrahman 12f182f0cf Define macros for C linkage 2024-10-05 22:06:13 +01:00
abdelrahman ffb99a3644 Fix MSVC errors and warnings 2024-10-05 20:07:48 +01:00
abdelrahman 1ddc5610f9 Remove aligned_alloc from libc allocator since it's not implemented on Windows 2024-10-05 19:11:13 +01:00
abdelrahman d8c7b3162f Split termcolour implementations by platform and simplify the API 2024-10-05 18:46:14 +01:00
abdelrahman 9e1e4688e4 Reformat 2024-10-05 18:45:32 +01:00
abdelrahman cd38672581 Add test for Arena's reallocation functionality 2024-09-14 17:28:07 +01:00
abdelrahman 7fea236618 Implement reallocation functionality for Arena allocator 2024-09-14 17:27:33 +01:00
abdelrahman 16a1b8fa35 Reformat 2024-09-14 14:49:18 +01:00
abdelrahman a0dfe8acd0 Start implementing realloc functions for Arena allocator 2024-09-14 13:39:59 +01:00
abdelrahman 95c47ec940 Update libc allocator realloc function 2024-09-14 13:39:32 +01:00
abdelrahman 46f32f2ba9 Update signature of realloc functions to expect old and new sizes 2024-09-14 13:38:55 +01:00
abdelrahman 8f794dee15 Reformat 2024-09-07 20:54:49 +01:00
abdelrahman 034b105ea1 Reformat 2024-09-07 20:53:20 +01:00
abdelrahman c90874ad10 Reformat 2024-09-07 20:49:13 +01:00
abdelrahman 8468bb8e28 Reorganise allocators 2024-09-07 20:27:49 +01:00
abdelrahman d30eee0cf8 Add tests for Allocator implementations 2024-09-07 15:43:47 +01:00
abdelrahman 59e56a75d3 Reimplement Allocator API for Arena 2024-09-07 15:43:25 +01:00
abdelrahman 5d6ce1d2c3 Restore libc Allocator implementation 2024-09-07 15:43:00 +01:00
abdelrahman ce537b7494 Restore Allocator implementation 2024-09-07 15:42:36 +01:00
abdelrahman b8f6e5f187 Fix bug in memory allocation function 2024-08-24 19:07:00 +01:00
abdelrahman 775f0864a8 Rename arena default allocation function 2024-08-23 22:29:56 +01:00
abdelrahman 8b6fb23bac Use size utils in arena tests 2024-08-23 21:50:22 +01:00
abdelrahman 1fb340561f Add size utils 2024-08-23 21:48:38 +01:00
abdelrahman 8ed372d938 Ensure stderr is piped to stdout to capture errors in output 2024-06-17 00:18:27 +01:00
abdelrahman 8a91a0ec6b Add tests for the shell commander 2024-06-17 00:15:10 +01:00
abdelrahman 802b70f5ee Add option to discard command output 2024-06-17 00:14:34 +01:00
abdelrahman 92c2439b56 Ensure cleanup on command failure 2024-06-16 23:29:19 +01:00
abdelrahman 781a46713b Add shell commander 2024-06-16 23:19:34 +01:00
abdelrahman 7c4725edef Add shell_utils 2024-06-16 23:18:52 +01:00
abdelrahman 4fc99f76a5 Move termcolour to shell 2024-06-16 23:17:54 +01:00
abdelrahman 25ab75f74f Move memory utilities to common 2024-06-16 15:30:53 +01:00
abdelrahman f6dd7e7aa8 Reorganise files 2024-06-16 12:29:43 +01:00
abdelrahman 8f5bee45c6 Reformat compile script 2024-06-12 23:20:49 +01:00
abdelrahman 25964d9a3c Run tests before building library 2024-06-09 22:46:17 +01:00
abdelrahman d9cf98da73 Rename print_test_result and exit on any failing function 2024-06-09 22:45:27 +01:00
abdelrahman 8c153b5321 Build tests on Windows 2024-06-09 22:31:14 +01:00
abdelrahman 3c4112d080 Remove building test.c from the Posix compilation script 2024-06-09 22:30:46 +01:00
abdelrahman aa28dd481b Platform abstraction for terminal colour 2024-06-09 22:30:21 +01:00
abdelrahman 42187beee5 Fix auto formatting 2024-06-09 22:29:30 +01:00
abdelrahman 8cc17f1490 Reformat and update types 2024-06-09 22:28:07 +01:00
abdelrahman b4c1301600 Update .gitignore 2024-06-09 22:25:46 +01:00
abdelrahman 2c556e12f1 Initial implementation of Windows build script 2024-06-09 18:27:34 +01:00
abdelrahman 6c82898225 Update dstr to remove MSVC warnings 2024-06-09 18:25:37 +01:00
abdelrahman a85508e0a4 Add padding to StringUpdate struct 2024-06-09 18:25:00 +01:00
abdelrahman cd78913e83 Add padding to arena and test_func_result structs 2024-06-09 17:40:41 +01:00
abdelrahman a0acada9b4 Fix Windows warning about assigning in conditional expression 2024-06-09 17:40:01 +01:00
abdelrahman 8eaa4afed1 Add WINDOWS_LEAN_AND_MEAN to mem_utils.c 2024-06-09 17:35:22 +01:00
abdelrahman 1ce07e9e4e Add WINDOWS_LEAN_AND_MEAN 2024-06-09 17:34:54 +01:00
abdelrahman 162b255e1b Add utility for calculating padding size 2024-06-09 17:34:16 +01:00
abdelrahman 99a9cd10f5 Update .gitignore 2024-06-09 16:20:15 +01:00
abdelrahman 7e1c25b649 Use out of source build 2024-06-09 16:19:44 +01:00
abdelrahman 9008e10651 Fix bug in dirup function 2024-06-09 16:19:26 +01:00
abdelrahman d27fc14b31 Fix termcolour include in tester.c 2024-06-09 15:26:20 +01:00
abdelrahman dbdab01a2c Merge branch 'temp' into 'main' 2024-06-09 01:50:51 +01:00
abdelrahman cf12144230 Add utility macros for arena initialisation 2024-06-09 01:46:23 +01:00
abdelrahman ccc86342cd Add address parameter to wapp_mem_util_alloc 2024-06-09 01:45:29 +01:00
abdelrahman 75bbb82058 Add helper macro for running test functions 2024-06-02 23:55:41 +01:00
abdelrahman 7fb13f2439 Update compile script to run tests 2024-06-02 23:35:34 +01:00
abdelrahman 0b63bc746d Add tests 2024-06-02 23:35:26 +01:00
abdelrahman 6ee3c762df Add terminal colour constants 2024-06-02 23:35:04 +01:00
abdelrahman 59f1c3eb58 Add testing utilities 2024-06-02 23:34:53 +01:00
abdelrahman 55d0c25c90 Reformat 2024-06-02 23:34:38 +01:00
abdelrahman cfc98e0137 Update .gitignore 2024-06-02 21:26:32 +01:00
abdelrahman 23886f40e8 Switch to using wapp_mem_util_alloc instead of calloc 2024-06-02 20:42:10 +01:00
abdelrahman 57de75c1f8 Set allocation flags per platform 2024-06-02 20:41:30 +01:00
abdelrahman 9807334ac9 Complete memory allocation and deallocation function definitions 2024-06-02 20:09:56 +01:00
abdelrahman 18448dd7c1 Define memory allocation and deallocation functions 2024-06-02 20:09:08 +01:00
abdelrahman 62fdef8601 Add platform detection definitions 2024-06-02 20:08:28 +01:00
abdelrahman 61c29ee564 Remove growing_arena and use base_arena 2024-06-02 01:17:03 +01:00
abdelrahman 36bc8ab54a Ignore test files 2024-06-02 01:16:46 +01:00
abdelrahman a8e5913254 Add release build and compile test 2024-06-02 01:16:24 +01:00
abdelrahman b59aedad89 Add BasicString and StringView 2024-04-29 23:22:59 +01:00
abdelrahman 3f5e3558b9 Add BasicString 2024-04-29 23:06:22 +01:00
abdelrahman bb2db0d30d Return StringUpdate from the dstr update functions 2024-04-29 22:55:40 +01:00
abdelrahman e75846a507 Update dstr to use Arena 2024-04-29 22:48:10 +01:00
abdelrahman 05e56d67ea Reorganise the code 2024-04-29 21:42:33 +01:00
abdelrahman 7164156c35 Simplify Arena 2024-04-28 22:59:37 +01:00
abdelrahman e67e1df9a5 Rename arena free functions 2024-04-28 22:04:23 +01:00
abdelrahman e206b4f4a6 Remove Allocator functions from Arena 2024-04-24 23:40:10 +01:00
abdelrahman 05bfa73509 Revert "Simplify Arena allocator"
This reverts commit d4313fb8e4.
2024-04-24 23:18:19 +01:00
abdelrahman d4313fb8e4 Simplify Arena allocator 2024-04-24 23:10:55 +01:00
abdelrahman 92db9206cc Remove complicated memory abstractions 2024-04-24 22:51:42 +01:00
abdelrahman 6195b521f5 Set minimum capacity for arena 2024-04-21 23:59:00 +01:00
abdelrahman be64571b0e Pass allocator as const * 2024-03-31 17:29:23 +01:00
abdelrahman 645686ae22 Remove unused variable 2024-03-31 17:05:04 +01:00
abdelrahman 3f9a908860 Address some minor bugs in dstr 2024-03-31 17:00:16 +01:00
abdelrahman 2e93bd794a Switch to using Allocator in dstr 2024-03-31 17:00:01 +01:00
abdelrahman 39c88505bd Fix bug with libc allocator where memory was set to 0 on reallocation 2024-03-31 16:58:38 +01:00
abdelrahman 970c588d66 Pass const Arena* to Allocator constuctor instead of Arena* 2024-03-25 07:52:49 +00:00
abdelrahman feada0b31c Add -O3 to compile flags 2024-03-24 08:10:40 +00:00
abdelrahman 6fc0b2987e Add extern "C" to all header files 2024-03-21 23:06:27 +00:00
abdelrahman 76222d31d4 Namespace all functions 2024-03-21 07:26:26 +00:00
abdelrahman 7948d3fd1a Ensure arena is freed when initialisation fails 2024-02-24 23:01:26 +00:00
abdelrahman 1094a9fefb Add comment for default alignment 2024-02-24 22:59:25 +00:00
abdelrahman b8db582098 Implement growing arena 2024-02-24 20:27:06 +00:00
abdelrahman a169fe3654 Return NULL when aligning forward if ptr is NULL 2024-02-24 20:26:37 +00:00
abdelrahman 9513c05b75 Handle NULL pointers in base arena 2024-02-24 18:44:43 +00:00
abdelrahman 633632105b Implement base arena allocator 2024-02-24 18:40:25 +00:00
abdelrahman 5a0aad5d52 Add memory utilities 2024-02-24 18:40:05 +00:00