Commit Graph

  • f9d1222bd7 Fix for wrong address alignment rounding development Olaf Barthel 2023-10-11 09:15:28 +0200
  • d37909e409 Documented why bypassing the read/write buffer is only attempted if there is at least a full buffer worth of data to be read or written. obarthel 2023-09-14 09:52:21 +0200
  • f5631d8bda The inner loop of the read operation already fills the buffer as far as it can go. No need to drop into "continue;". obarthel 2023-09-11 17:36:32 +0200
  • 9a9ae7d6fd The SIGABRT handler can no longer invoke abort() recursively. obarthel 2023-09-10 11:45:38 +0200
  • 64ab8643b5 The size of a slab entry is now calculated inside a single local function, rather than calculated differently in different parts of stdlib_slab.c. This change made it easier to simplify the implementation. obarthel 2023-09-10 11:17:00 +0200
  • f7fd63acb4 Indentation fix. obarthel 2023-09-10 11:15:25 +0200
  • 8bd7403ae3 The 'struct MemoryNode' is now so larger than the smallest usable allocation size is now 16 bytes. obarthel 2023-09-10 11:15:15 +0200
  • 5efacb1a2b Fix for unnecessary compiler warnings. obarthel 2023-09-10 11:14:32 +0200
  • 7207c96a6f Made the slab allocator work with libunix.a again. obarthel 2023-09-09 18:36:09 +0200
  • 21bc996705 Fixed to make use of the aligned slab address when verifying that the slab node is present in the slab. The requested slab size is now properly rounded up to a power of 2 and will always be limited to a valid range. obarthel 2023-09-09 18:35:31 +0200
  • 438fd5bbd2 Fixed the MemoryNode padding, which was short of a 32 bit word. obarthel 2023-09-09 18:33:38 +0200
  • 101846e423 If the memory management system constructor fails, it now prints some diagnostic debug output. obarthel 2023-09-09 18:32:50 +0200
  • fba7f7da9b Small type corrections. obarthel 2023-09-09 12:55:13 +0200
  • 115099698a Added an assertion to verify that the first free chunk on the slab's list is really always available. obarthel 2023-09-09 12:55:01 +0200
  • 4f3d0c981c If the memory debug option is active, realloc() can no longer damage the trailing guard area. obarthel 2023-09-09 12:54:16 +0200
  • 96af3a1165 Reformatted, so that it might be a bit more readable. obarthel 2023-09-08 17:20:51 +0200
  • 6cabff4bbb Added the missing semicolon; obarthel 2023-09-08 17:20:16 +0200
  • 71708e84ce The memory debugging code now places the the damage detection areas which bracket the allocation area so that the originally requested allocation size is used, not the rounded-up size. Debug output in memory node checking no longer counts the non-breaking space character as unprintable. obarthel 2023-09-08 16:11:01 +0200
  • 3d70b18c23 Simplified how the slab allocator, the memory pool or AllocMem() are being used. Added robust integer overflow detection. Allocation sizes are now padded to a multiple of MEM_BLOCKSIZE. Repaired how the plain AllocMem() allocations are managed. alloca() cleanup is disabled during the stdlib_memory_exit destructor's work. The stdlib_memory_init constructor is more robust and now insists that exec.library V39+ uses memory pools. obarthel 2023-09-08 16:08:45 +0200
  • 842acf2eaa Updated to properly use the MemoryNode changes. obarthel 2023-09-08 16:05:29 +0200
  • b9463f442b Added notes on calloc() being safe to use under certain circumstances if the number of elements or the element size happens to be 0. In effect, malloc() will decide what is going to happen. obarthel 2023-09-08 16:04:53 +0200
  • 7ceeb4f8ed If alloca() would end up returning a NULL pointer, it now invokes the default alloca trap function, which calls abort(). You can override this, if you need to. obarthel 2023-09-08 16:03:47 +0200
  • fc8051f724 Modifed the MemoryNode so that its size will always be a multiple of MEM_BLOCKSIZE. The SlabSingleAllocation is now always a multiple of MEM_BLOCKSIZE, too. Tracking whether a MemoryNode is not supposed to be freed is now accomplished through dedicated flag instead of repurposing the allocation size field. obarthel 2023-09-08 16:02:37 +0200
  • 64ba9b5389 Added the __addition_overflows() function prototype, which is used by code which checks for unsigned 32 bit integer sums exceeding the range of an unsigned 32 bit integer. obarthel 2023-09-08 16:00:38 +0200
  • 1286b86f07 Added more robust integer overflow detection. Slab memory is now allocated so that its address starts on a MEM_BLOCKSIZE boundary. obarthel 2023-09-08 15:59:19 +0200
  • 8101b43fc5 Tpyo correction obarthel 2023-09-08 15:52:06 +0200
  • efaffd9182 Typo corection obarthel 2023-09-08 15:51:13 +0200
  • 6197531c90 Added integer overflow checking for the element_size and count parameters. Olaf Barthel 2023-09-06 13:28:48 +0200
  • b94937ff38 Fixed the bug which broke both fgets() and gets(): copying data from the FILE buffer failed to bump the destination string pointer. Also added an abort check in order to avoid turning the memcpy() operation into an uninterruptable sequence. Olaf Barthel 2023-09-06 13:27:45 +0200
  • 2cb54d48a9 Added the common function which both fputs() and puts() share now. Olaf Barthel 2023-09-06 13:24:45 +0200
  • a7389454bb fputs() and puts() now share the same common code. Added abort checks in order to avoid turning the memcpy() operations into an uninterruptable sequence. Olaf Barthel 2023-09-06 13:24:15 +0200
  • 45d118101a Added assertion test for the buffer alignment padding size. Olaf Barthel 2023-09-06 13:22:07 +0200
  • e4a703000a Reactivated memory debugging features. Added more robust integer overflow checking. Olaf Barthel 2023-09-06 13:21:13 +0200
  • 8a4a75e721 Optionally, the slab allocator can be built to deliver 64-bit aligned allocations by default. Also, the slab allocator is no longer enabled at build time. Olaf Barthel 2023-09-06 13:20:10 +0200
  • 4cb621d24d Added documentation on side-effects caused by using MEMF_CLEAR obarthel 2022-03-30 09:33:25 +0200
  • ff5826c54e Small changes to the code documentation obarthel 2021-12-23 13:08:08 +0100
  • e6ef7da8d0 Fix crash when profiling without performancemonitor resource Mathias Parnaudeau 2021-12-08 09:19:21 +0100
  • b7ce13cbf8 Changed the internal data structures for slab allocations to yield 64-bit-aligned memory allocations. This can be tuned with the __MEM_ALLOCATIONS_64_BIT_ALIGNED preprocessor symbol. obarthel 2021-09-27 11:03:08 +0200
  • e71249a15b Removed the profile_profile.o file from the library to be be built. Added a comment explaining why this was necessary. obarthel 2021-09-27 11:00:54 +0200
  • 19323ec218 The aggressive loop optimization option can be disabled/enabled as needed through a variable. obarthel 2021-09-27 11:00:20 +0200
  • cc8b81e7cc Added a 'C' implementation for the memory pools functions obarthel 2021-06-22 15:15:29 +0200
  • 133ff59571
    Merge fdae3ef238 into c02665938f Ola Söder 2021-05-24 20:56:47 +0200
  • 997af48ec4
    Merge d49d8c2386 into c02665938f Ola Söder 2021-05-14 00:38:50 +0200
  • c02665938f
    Merge pull request #13 from sodero/topic/additional_error_codes master Jens Maus 2021-05-14 00:38:42 +0200
  • 1e2863c5b8
    fixed README.md Jens Maus 2021-05-14 00:32:09 +0200
  • e1da3dadfb
    moved from travis-ci to github actions and retired codeclimate. Jens Maus 2021-05-14 00:31:17 +0200
  • fdae3ef238 Fix sqrt. Ola Söder 2021-02-01 19:10:25 +0100
  • d49d8c2386 Fix tgamma. Ola Söder 2021-02-02 18:16:56 +0100
  • b51c79577e Add ENOTSUP error code. ola.soder@axis.com 2021-01-20 15:34:37 +0100
  • 975f949aa1 Rewritten to handle date ranges better which lie outside the expected time of day, day of month and month. obarthel 2020-07-06 12:09:51 +0200
  • a7efdabefc Rewritten to handle date ranges better which lie outside the expected time of day, day of month and month. obarthel 2020-07-06 12:01:35 +0200
  • 57774795af Typo correction. Olaf Barthel 2020-02-27 12:15:30 +0100
  • 9d99542299 Fix for indentation error. Olaf Barthel 2020-02-27 12:15:17 +0100
  • e02089e28a Better handling of unbuffered mode for interactive streams obarthel 2019-08-24 14:05:09 +0200
  • 2bcfec3e60 Optimizations for better write performance. obarthel 2019-08-24 14:03:34 +0200
  • 4a01746be2 Optimizations for better write performance. obarthel 2019-08-24 14:00:03 +0200
  • 914ef57844 Changed how size=0 plays out obarthel 2019-08-24 13:58:04 +0200
  • 089ae11181 Improvements for better read performance. obarthel 2019-08-24 13:55:31 +0200
  • ae13cd77fc Optimizations for better read performance. obarthel 2019-08-24 13:53:48 +0200
  • 3f21e90fca Optimizations for better read performance obarthel 2019-08-24 13:50:41 +0200
  • 5f14118d73 Fix for translation bug, which would make "a/../b" into "a./b". Contributed by Thomas Frieden - thank you very much! Olaf Barthel 2018-12-05 13:31:43 +0100
  • b874ff71de Add wcscoll() dummy. Sebastian Bauer 2018-04-22 11:21:24 +0200
  • 397013922c Use IsMinListEmpty() for MinList rather than IsListEmpty(). Sebastian Bauer 2018-04-10 23:20:20 +0200
  • 85c36839d5 Create the proper directoy for MAKELIB. Sebastian Bauer 2018-04-10 23:19:10 +0200
  • 196d37b28a Compile with -nostdlib, rather than -mcrt=clib2. Sebastian Bauer 2018-04-10 23:18:30 +0200
  • e8086be768 Disable -Wunused-label. Sebastian Bauer 2018-04-10 23:17:08 +0200
  • 82dd474e3b Disable -Wbad-function-cast. It produces a lot of useless warnings. Sebastian Bauer 2018-04-09 23:24:49 +0200
  • 58f36203b1 Fix cast to function pointer. Sebastian Bauer 2018-04-09 23:24:07 +0200
  • 425f899302
    Merge pull request #7 from sba1/wchar-fixes Sebastian Bauer 2018-03-31 09:37:50 +0200
  • febe89c61b Update changelog. Sebastian Bauer 2018-03-30 22:17:41 +0200
  • 3e50be491b Include stdint.h for WCHAR_MAX to avoid redundant definitions. Sebastian Bauer 2018-03-30 21:42:12 +0200
  • dfc7f310d6 Don't define wchar_t in C++ as it is a bultin-type there. Sebastian Bauer 2018-03-30 21:35:06 +0200
  • a6a9352a00 Compile wchar_wscoll.c. Sebastian Bauer 2018-03-30 21:21:31 +0200
  • eb1d784c0d Provide stub for mbrtowc(). Sebastian Bauer 2018-03-30 21:21:11 +0200
  • d1092099d0 Provide some more wide char functions. Sebastian Bauer 2018-03-29 20:59:02 +0200
  • bc621bed9c Disable the LOG_COMMAND. Sebastian Bauer 2018-03-29 20:57:32 +0200
  • 60eebbe732 Implement wcscat(). Sebastian Bauer 2018-03-28 21:19:47 +0200
  • 345995000a Implement some more of the iswXXX() functions. Sebastian Bauer 2018-03-28 21:16:14 +0200
  • ef18bf5f3e Fix vswprintf() prototype. Sebastian Bauer 2018-03-28 18:47:24 +0200
  • 6f3b3b6d28 Implement few wide char functions. Sebastian Bauer 2018-03-28 17:09:18 +0200
  • 846eebc66c Fix mbtowc() to and compile it. Sebastian Bauer 2018-03-28 17:08:42 +0200
  • 75d47ccdad Build all existing wchar and wctype functions. Sebastian Bauer 2018-03-27 20:03:45 +0200
  • 456123fe7f Add dummy wctob(). Sebastian Bauer 2018-03-27 20:02:54 +0200
  • 5733c99ba1 Fix wcspbrk() definition to match the prototype. Sebastian Bauer 2018-03-27 20:00:28 +0200
  • 391e7e39ad Add wcscoll() prototype. Sebastian Bauer 2018-03-27 19:59:54 +0200
  • f5f0e17e78 Define ISO 99 multibyte functions also in C++ context. Sebastian Bauer 2018-03-27 19:59:23 +0200
  • f6f0082a0e Include sys/clib2_stdc.h for restrict. Sebastian Bauer 2018-03-27 19:56:45 +0200
  • c84b1fc1ff Tiny fixes obarthel 2018-02-18 13:58:25 +0100
  • e35307a7e3 Ignore linker map files, too. obarthel 2018-02-17 13:45:21 +0100
  • 911114c286 add an unimplemented tzset(). ctime_r() and localtime_r() are already using the localtime, so no need to do anything. http://pubs.opengroup.org/onlinepubs/9699919799/functions/tzset.html Henning Nielsen Lund 2017-08-27 13:30:12 +0200
  • 9e998ca108 should have been sys/clib2_stdc.h Henning Nielsen Lund 2017-08-15 21:53:49 +0200
  • 99695dec0b we use restrict Henning Nielsen Lund 2017-08-15 21:45:33 +0200
  • 0ec7094877 Code depending on statfs or fstatfs do both depend on sys/mount.h and sys/param.h where we only had sys/mount.h Henning Nielsen Lund 2017-08-15 21:26:45 +0200
  • a471e73adf add timespec declaration Henning Nielsen Lund 2017-08-05 17:28:39 +0200
  • c76bf8e20b add strnlen() Henning Nielsen Lund 2017-08-01 21:28:07 +0200
  • 309bbd8c8c Add a few extra wide-character prototypes and the missing typedef locale_t Henning Nielsen Lund 2017-08-01 21:26:59 +0200
  • d6e5769bc5 using restrict, so restrict to c99 Henning Nielsen Lund 2017-08-01 14:52:45 +0200
  • 976b6ae7e1 Change the mbrlen declaration to equal ISO C. http://pubs.opengroup.org/onlinepubs/9699919799/functions/mbrlen.html Henning Nielsen Lund 2017-08-01 13:55:11 +0200
  • 8af96cb6cb Merge branch 'master' of https://github.com/adtools/clib2 obarthel 2017-07-08 18:10:45 +0200
  • febe690623 This got lost last year obarthel 2017-07-08 18:10:28 +0200