Giter Site home page Giter Site logo

embeddedartistry / libmemory Goto Github PK

View Code? Open in Web Editor NEW
206.0 11.0 42.0 367 KB

Embedded systems memory management library. Implementations for malloc(), free(), and other useful memory management functions

Home Page: https://embeddedartistry.com

License: MIT License

C 55.71% Makefile 10.53% Meson 25.45% Groovy 7.57% C++ 0.74%
libc c malloc malloc-free memory-allocation bringup embedded-systems portability rtos heap

libmemory's People

Contributors

phillipjohnston avatar stefanct avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libmemory's Issues

Error libmemory at compiling time

file_updated.tar.gz

Issue Template

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Project Version/Tag/Comit: embeddedartistry/libmemory/f2c623eae52e511eb1e10b9ee0b2da9f13c01c60
  • Operating System: Detected OS: Linux.
  • SDK version:
  • Toolchain version:

By the way, I'm compiling usin the c99 flag

Expected Behavior

It should compile. I haven't tested the lib yet so I don't know if it works.

Current Behavior

I'm sorry, I'm not sure that it should be notified in an issue...

There were some errors at compiling time :

Premake did not work

I had to re-install it from https://premake.github.io/download.html to libmemory-master/build/bin/Linux

Erros themselfs

I put the updated file the tar.gz if you want to take a look, there are not a lo of things to update
The errors details are in the part "Failure Logs"

Linking libmemory_freertos ==== Building libmemory_freelist_UnitTests (debug_x86_64) ====

In libmemory-master/test/src/aligned_malloc.c

==== Building libmemory_freelist_UnitTests (debug_x86_64) ====

In libmemory-master/test/src/malloc_freelist.c

==== Building libmemory_freelist_UnitTests (debug_x86_64) ====

In libmemory-master/test/support/memory.c corrected by :

At linking time

I had to re-install cmocka from this https://cmocka.org/files/1.1/ to libmemory-master/arch/x86_64/lib/cmocka

And even with this I got these warnings :
Linking libmemory_freelist_UnitTests
make[1] : on quitte le répertoire « /home/macerab/software/libmemory-master/build/gen »
Warning: ignoring unsupported tag ALLOW_UNICODE_NAMES =' at line 79, file docs/Doxyfile Warning: ignoring unsupported tag TOC_INCLUDE_HEADINGS =' at line 313, file docs/Doxyfile
Warning: ignoring unsupported tag GROUP_NESTED_COMPOUNDS =' at line 370, file docs/Doxyfile Warning: ignoring unsupported tag HIDE_COMPOUND_REFERENCE=' at line 541, file docs/Doxyfile
Warning: ignoring unsupported tag SHOW_GROUPED_MEMB_INC =' at line 554, file docs/Doxyfile Warning: ignoring unsupported tag WARN_AS_ERROR =' at line 765, file docs/Doxyfile
Warning: ignoring unsupported tag LATEX_EXTRA_STYLESHEET =' at line 1743, file docs/Doxyfile Warning: ignoring unsupported tag LATEX_TIMESTAMP =' at line 1810, file docs/Doxyfile
Warning: ignoring unsupported tag RTF_SOURCE_CODE =' at line 1876, file docs/Doxyfile Warning: ignoring unsupported tag MAN_SUBDIR =' at line 1911, file docs/Doxyfile
Warning: ignoring unsupported tag DOCBOOK_PROGRAMLISTING =' at line 1974, file docs/Doxyfile Warning: ignoring unsupported tag DIA_PATH =' at line 2183, file docs/Doxyfile
Warning: ignoring unsupported tag DIAFILE_DIRS =' at line 2395, file docs/Doxyfile Warning: ignoring unsupported tag PLANTUML_JAR_PATH =' at line 2403, file docs/Doxyfile
Warning: ignoring unsupported tag PLANTUML_CFG_FILE =' at line 2408, file docs/Doxyfile Warning: ignoring unsupported tag PLANTUML_INCLUDE_PATH =' at line 2413, file docs/Doxyfile
warning: source docs/dot/ is not a readable file or directory... skipping.
/home/macerab/software/libmemory-master/docs/CONTRIBUTING.md:79: warning: Illegal command mbeddedartistry as part of a .. block
/home/macerab/software/libmemory-master/docs/CONTRIBUTING.md:326: warning: Illegal command mbeddedartistry as part of a .. block
/home/macerab/software/libmemory-master/README.md:110: warning: Illegal command mbeddedartistry as part of a .. block

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. go to libmemory-master root
  2. run make

Failure Logs

Premake did not work

Detected OS: Linux. Using Premake binary: build/bin/Linux/premake5
Error: module 'build/modules/arch' not found:
no field package.preload['build/modules/arch']
no file '/usr/local/share/lua/5.3/build/modules/arch.lua'
no file '/usr/local/share/lua/5.3/build/modules/arch/init.lua'
no file '/usr/local/lib/lua/5.3/build/modules/arch.lua'
no file '/usr/local/lib/lua/5.3/build/modules/arch/init.lua'
no file './build/modules/arch.lua'
no file './build/modules/arch/init.lua'
no file '/usr/local/lib/lua/5.3/build/modules/arch.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './build/modules/arch.so'
no file '/home/macerab/software/libmemory-master/build/bin/Linux/build/modules/arch.so'

Linking libmemory_freertos ==== Building libmemory_freelist_UnitTests (debug_x86_64) ====

==== Building libmemory_freelist_UnitTests (debug_x86_64) ====
main.c
aligned_malloc.c
../../test/src/aligned_malloc.c: In function ‘aligned_malloc_test’:
../../test/src/aligned_malloc.c:33:13: erreur: redefinition of ‘align’
for(size_t align = 2; align <= 8192; align *= 2)
^
../../test/src/aligned_malloc.c:31:9: note: previous definition of ‘align’ was here
size_t align = 2;
^
../../test/src/aligned_malloc.c:33:2: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
for(size_t align = 2; align <= 8192; align *= 2)
^
../../test/src/aligned_malloc.c:33:2: note: use option -std=c99 or -std=gnu99 to compile your code
../../test/src/aligned_malloc.c:43:13: erreur: redefinition of ‘align’
for(size_t align = 2; align <= 8192; align *= 2)
^
../../test/src/aligned_malloc.c:33:13: note: previous definition of ‘align’ was here
for(size_t align = 2; align <= 8192; align *= 2)
^
../../test/src/aligned_malloc.c:43:2: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
for(size_t align = 2; align <= 8192; align *= 2)
^
make[2]: *** [obj/x86_64/debug/libmemory_freelist_UnitTests/aligned_malloc.o] Erreur 1
make[1]: *** [libmemory_freelist_UnitTests] Erreur 2
make[1] : on quitte le répertoire « /home/macerab/software/libmemory-master/build/gen »
make: *** [build] Erreur 2

==== Building libmemory_freelist_UnitTests (debug_x86_64) ====

==== Building libmemory_freelist_UnitTests (debug_x86_64) ====
aligned_malloc.c
malloc_freelist.c
../../test/src/malloc_freelist.c: In function ‘malloc_test’:
../../test/src/malloc_freelist.c:47:2: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:47:2: note: use option -std=c99 or -std=gnu99 to compile your code
../../test/src/malloc_freelist.c:55:10: erreur: redefinition of ‘i’
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:47:10: note: previous definition of ‘i’ was here
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:55:2: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:61:10: erreur: redefinition of ‘i’
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:55:10: note: previous definition of ‘i’ was here
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:61:2: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:69:10: erreur: redefinition of ‘i’
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:61:10: note: previous definition of ‘i’ was here
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
../../test/src/malloc_freelist.c:69:2: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < ALLOCATION_TEST_COUNT; i++)
^
make[2]: *** [obj/x86_64/debug/libmemory_freelist_UnitTests/malloc_freelist.o] Erreur 1
make[1]: *** [libmemory_freelist_UnitTests] Erreur 2
make[1] : on quitte le répertoire « /home/macerab/software/libmemory-master/build/gen »
make: *** [build] Erreur 2

==== Building libmemory_freelist_UnitTests (debug_x86_64) ====

==== Building libmemory_freelist_UnitTests (debug_x86_64) ====
malloc_freelist.c
memory.c
../../test/support/memory.c:11:16: erreur: variably modified ‘mem_block’ at file scope
static uint8_t mem_block[memblock_size];
^
../../test/support/memory.c:13:1: erreur: un élément de l'initialisation n'est pas une constante
static const intptr_t mem_block_addr_end = mem_block_addr + memblock_size;
^
make[2]: *** [obj/x86_64/debug/libmemory_freelist_UnitTests/memory.o] Erreur 1
make[1]: *** [libmemory_freelist_UnitTests] Erreur 2
make[1] : on quitte le répertoire « /home/macerab/software/libmemory-master/build/gen »
make: *** [build] Erreur 2

At linking time

Linking libmemory_freelist_UnitTests
obj/x86_64/debug/libmemory_freelist_UnitTests/main.o: dans la fonction « main »:
/home/macerab/software/libmemory-master/build/gen/../../test/main.c:24: référence indéfinie vers « cmocka_set_message_output »
obj/x86_64/debug/libmemory_freelist_UnitTests/aligned_malloc.o: dans la fonction « aligned_malloc_test »:
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:25: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:36: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:37: référence indéfinie vers « _assert_in_range »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:38: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:46: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:47: référence indéfinie vers « _assert_in_range »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:48: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:54: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:58: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:62: référence indéfinie vers « _assert_true »
obj/x86_64/debug/libmemory_freelist_UnitTests/aligned_malloc.o: dans la fonction « aligned_malloc_tests »:
/home/macerab/software/libmemory-master/build/gen/../../test/src/aligned_malloc.c:69: référence indéfinie vers « _cmocka_run_group_tests »
obj/x86_64/debug/libmemory_freelist_UnitTests/malloc_freelist.o: dans la fonction « malloc_test »:
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:30: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:38: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:39: référence indéfinie vers « _assert_in_range »
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:45: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:51: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:52: référence indéfinie vers « _assert_in_range »
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:65: référence indéfinie vers « _assert_true »
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:66: référence indéfinie vers « _assert_in_range »
obj/x86_64/debug/libmemory_freelist_UnitTests/malloc_freelist.o: dans la fonction « malloc_tests »:
/home/macerab/software/libmemory-master/build/gen/../../test/src/malloc_freelist.c:80: référence indéfinie vers « _cmocka_run_group_tests »
collect2: erreur: ld a retourné 1 code d'état d'exécution
make[2]: *** [../../buildresults/x86_64_debug/test/libmemory_freelist.bin] Erreur 1
make[1]: *** [libmemory_freelist_UnitTests] Erreur 2
make[1] : on quitte le répertoire « /home/macerab/software/libmemory-master/build/gen »
make: *** [build] Erreur 2

"fatal error: memory.h: No such file or directory" when compiling.

I was trying to cross-compile this library using the following make command:

make CROSS=arm:cortex-a53

However, I got the following compiler error:

FAILED: src/libmemory.a.p/malloc_addblock_init_assert.c.o
arm-none-eabi-gcc -Isrc/libmemory.a.p -Isrc/ -I../src -Iinclude -I../include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c11 -O2 -fdiagnostics-show-option -ffunction-sections -fdata-sections -fdevirtualize -Wno-unknown-pragmas -Wno-padded -Wfloat-equal -Wconversion -Wlogical-op -Wundef -Wredundant-decls -Wshadow -Wstrict-overflow=2 -Wwrite-strings -Wpointer-arith -Wcast-qual -Wformat=2 -Wmissing-include-dirs -Wcast-align -Wswitch-enum -Wsign-conversion -Wdisabled-optimization -Winvalid-pch -Wmissing-declarations -Wdouble-promotion -Wshadow -Wtrampolines -Wvector-operation-performance -Wshift-overflow=2 -Wnull-dereference -Wduplicated-cond -Wshift-overflow=2 -Wnull-dereference -Wduplicated-cond -Wno-pedantic -mcpu=cortex-a53 -mfloat-abi=hard -mabi=aapcs -fPIC -MD -MQ src/libmemory.a.p/malloc_addblock_init_assert.c.o -MF src/libmemory.a.p/malloc_addblock_init_assert.c.o.d -o src/libmemory.a.p/malloc_addblock_init_assert.c.o -c ../src/malloc_addblock_init_assert.c
../src/malloc_addblock_init_assert.c:8:20: fatal error: memory.h: No such file or directory
 #include <memory.h>

To fix this, I uncommented all instances of the following includes and compiled without errors.

 #include <memory.h>

My main question is: what is the purpose of this includes?

Clean up header includes

Libmemory includes doesn't need to reference the linked list dependency. That should only be included on the library side. The tests and any consumers don't need access.

Add test for overlapping memory blocks

malloc - add tests that none of the returned blocks overlap.

Non-overlap would mean that each returned address + size does not fall within the bounds of another returned address / size.

ea-ci/libmemory/PR-4-head: #13 failed

Build 'ea-ci/libmemory/PR-4-head' is failing!

Last 50 lines of build output:

[...truncated 8.72 KB...]
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../dependencies/lib/linkedlist/ll.h:21:42: note: expanded from macro 'container_of'
                (type*)((char*)__mptr - offsetof(type, member));      \
                                        ~~~~~~~~~~~~~~~^~~~~~~
../../dependencies/lib/linkedlist/ll.h:13:56: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) ((size_t) & ((TYPE*)0)->MEMBER)
                                           ~~~~~~~~~~  ^
../../src/malloc_freelist.c:127:7: error: assigning to 'alloc_node_t *' from incompatible type 'void'
                blk = container_of(ptr, alloc_node_t, block);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/malloc_freelist.c:154:56: error: no member named 'block' in 'alloc_node_t'
        blk->size = (uintptr_t)addr + size - (uintptr_t)blk - ALLOC_HEADER_SZ;
                                                              ^~~~~~~~~~~~~~~
../../src/malloc_freelist.c:36:48: note: expanded from macro 'ALLOC_HEADER_SZ'
#define ALLOC_HEADER_SZ offsetof(alloc_node_t, block)
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../dependencies/lib/linkedlist/ll.h:13:56: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) ((size_t) & ((TYPE*)0)->MEMBER)
                                           ~~~~~~~~~~  ^
11 errors generated.
make[2]: *** [obj/x86_64/debug/libmalloc_freelist/malloc_freelist.o] Error 1
make[1]: *** [libmalloc_freelist] Error 2
make: *** [build] Error 2
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Format)
Stage 'Format' skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] echo
Gathering SCM changes
[Pipeline] slackSend
run slackstepsend, step null:false, desc KywGMjF0sBstgPYC2Lqjhzyy:false
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: true, color: false
[Pipeline] sh
[ea-ci_libmemory_PR-4-head-F6HHQJKDAUEWUS7VTTTTB6HHUO3LWCSM7JWZ7BH5S5D3IK7BCDZQ] Running shell script
+ git config --get remote.origin.url
[Pipeline] readFile
[Pipeline] echo
Creating a GitHubPluginConfig for credential 4c01f168-ca25-483e-bc6d-8d105fc5fb70
[Pipeline] echo
Registering GithubProjectProperty for repo URL https://github.com/embeddedartistry/libmemory
[Pipeline] properties
[Pipeline] echo
Build failed! Filing GitHub issue
[Pipeline] step

Changes since last successful build:

  • [Phillip Johnston] b3b5174 - Introduce failure

  • [Phillip Johnston] bf3beebfa9fede64039c8dc25dbd7f532a67d6ee - More

  • [Phillip Johnston] 8289caf - try

  • [Phillip Johnston] 5cf2c83 - try this instead

  • [Phillip Johnston] 30071f37e82970d4783d0279936409536a244496 - try

  • [Phillip Johnston] 5e48bb6fcdc786094f02c5e0d9ab76a59245bb27 - Try

  • [Phillip Johnston] ac8b4359545eaedba4b1bbcac1395b12dcd6ece9 - does order matter?

No changes
No changes

  • [Phillip Johnston] 6de55a6cbabae922924de4ad0742a5f1a3496af8 - Try

  • [Phillip Johnston] ff81802 - try different credentials

No changes

  • [Phillip Johnston] 058e78e200e48a8027a6b21aab89dd0b0ed1e832 - wip

  • [Phillip Johnston] fff4c7ee774fd850e6654935eaa7f730133648cc - Support filing Github issues on build failures

  • [Phillip Johnston] 7984154f7df33e32707f055587ce0ffa081600b3 - Add documentation for new commands

  • [Phillip Johnston] 785d66177227625a77fd20dda64a8eb2d6a6872b - Add slackSend step to a try/catch block. Slack failures shouldn't stop

  • [Phillip Johnston] 45f934f4b4e683919d1175de0705f908d5fb6b0c - try

  • [Phillip Johnston] 80dd38ae78a4ad5acd44b72833a5fe4e952c8edb - try 2

  • [Phillip Johnston] 92de4fe6b5059c1cc7e1e81e00e6e1fed7fb8dc9 - Tr

  • [Phillip Johnston] 52b0b5c49a39015ae2532b2c51b01556e54faf81 - wip

  • [Phillip Johnston] 96cb9c581b141f1bb94f4a5847a9adb74bce5650 - Try

  • [Phillip Johnston] 098a77d1b219acf132f41de70ef7a764540e0dd9 - Try

  • [Phillip Johnston] 13370ec - Add prints

  • [Phillip Johnston] 0b87229 - Try

  • [Phillip Johnston] bd9d7dc - try

View full output

ea-nightly/libmemory/master: #34 Failed

Build ea-nightly/libmemory/master #34 Failed

View full output

Change log:

  • 72f713d: Advance build submodule [Phillip Johnston]

Last 75 of output:

[...truncated 20.89 KB...]
1 error generated.
[3/17] Compiling C object 'src/src@@@memory_freelist@sta/aligned_malloc.c.o'.
FAILED: src/src@@@memory_freelist@sta/aligned_malloc.c.o 
/usr/local/Cellar/llvm/6.0.1/share/clang/tools/scan-build/bin/../libexec/ccc-analyzer -Isrc/src@@@memory_freelist@sta -Isrc/ -I../../../src -I../../../include -I../../../dependencies/lib -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -std=c11 -O0 -g -pedantic -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-exit-time-destructors -Wno-global-constructors -fcolor-diagnostics  -MD -MQ 'src/src@@@memory_freelist@sta/aligned_malloc.c.o' -MF 'src/src@@@memory_freelist@sta/aligned_malloc.c.o.d' -o 'src/src@@@memory_freelist@sta/aligned_malloc.c.o' -c ../../../src/aligned_malloc.c
../../../src/aligned_malloc.c:6:10: fatal error: 'assert.h' file not found
#include <assert.h>
         ^~~~~~~~~~
1 error generated.
[4/17] Compiling C object 'src/src@@@memory_threadx@sta/aligned_malloc.c.o'.
FAILED: src/src@@@memory_threadx@sta/aligned_malloc.c.o 
/usr/local/Cellar/llvm/6.0.1/share/clang/tools/scan-build/bin/../libexec/ccc-analyzer -Isrc/src@@@memory_threadx@sta -Isrc/ -I../../../src -I../../../include -I../../../dependencies/lib -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -std=c11 -O0 -g -pedantic -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-exit-time-destructors -Wno-global-constructors -fcolor-diagnostics -isystem ../../../src/../dependencies/rtos/  -MD -MQ 'src/src@@@memory_threadx@sta/aligned_malloc.c.o' -MF 'src/src@@@memory_threadx@sta/aligned_malloc.c.o.d' -o 'src/src@@@memory_threadx@sta/aligned_malloc.c.o' -c ../../../src/aligned_malloc.c
../../../src/aligned_malloc.c:6:10: fatal error: 'assert.h' file not found
#include <assert.h>
         ^~~~~~~~~~
1 error generated.
[5/17] Compiling C object 'src/src@@@memory_threadx@sta/malloc_threadx.c.o'.
FAILED: src/src@@@memory_threadx@sta/malloc_threadx.c.o 
/usr/local/Cellar/llvm/6.0.1/share/clang/tools/scan-build/bin/../libexec/ccc-analyzer -Isrc/src@@@memory_threadx@sta -Isrc/ -I../../../src -I../../../include -I../../../dependencies/lib -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -std=c11 -O0 -g -pedantic -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-exit-time-destructors -Wno-global-constructors -fcolor-diagnostics -isystem ../../../src/../dependencies/rtos/  -MD -MQ 'src/src@@@memory_threadx@sta/malloc_threadx.c.o' -MF 'src/src@@@memory_threadx@sta/malloc_threadx.c.o.d' -o 'src/src@@@memory_threadx@sta/malloc_threadx.c.o' -c ../../../src/malloc_threadx.c
../../../src/malloc_threadx.c:6:10: fatal error: 'assert.h' file not found
#include <assert.h>
         ^~~~~~~~~~
1 error generated.
[6/17] Compiling C object 'src/src@@@memory_freelist_native@sta/malloc_freelist.c.o'.
FAILED: src/src@@@memory_freelist_native@sta/malloc_freelist.c.o 
/usr/local/Cellar/llvm/6.0.1/share/clang/tools/scan-build/bin/../libexec/ccc-analyzer -Isrc/src@@@memory_freelist_native@sta -Isrc/ -I../../../src -I../../../include -I../../../dependencies/lib -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -std=c11 -O0 -g -pedantic -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-exit-time-destructors -Wno-global-constructors -fcolor-diagnostics  -MD -MQ 'src/src@@@memory_freelist_native@sta/malloc_freelist.c.o' -MF 'src/src@@@memory_freelist_native@sta/malloc_freelist.c.o.d' -o 'src/src@@@memory_freelist_native@sta/malloc_freelist.c.o' -c ../../../src/malloc_freelist.c
In file included from ../../../src/malloc_freelist.c:6:
../../../dependencies/lib/linkedlist/ll.h:4:10: fatal error: 'stdlib.h' file not found
#include <stdlib.h> //size_t, NULL
         ^~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
scan-build: Removing directory '/Users/pjohnston/.jenkins/workspace/ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q/buildresults/meson-logs/scanbuild/2018-11-05-053022-34761-1' because it contains no reports.
scan-build: No bugs found.
FAILED: meson-scan-build 
/usr/local/opt/python/bin/python3.7 /usr/local/Cellar/meson/0.47.2/libexec/bin/meson --internal scanbuild /Users/pjohnston/.jenkins/workspace/ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q /Users/pjohnston/.jenkins/workspace/ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q/buildresults /usr/local/opt/python/bin/python3.7 /usr/local/Cellar/meson/0.47.2/libexec/bin/meson -Denable-pedantic-error=false -Denable-werror=false
ninja: build stopped: subcommand failed.
make: *** [analyze] Error 1
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Documentation)
Stage "Documentation" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (ScanWorkspace)
Stage "ScanWorkspace" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] echo
Sending slack message: <http://136.24.14.137:12345/job/ea-nightly/job/libmemory/job/master/34/display/redirect|ea-nightly/libmemory/master #34>: *FAILED*
Changes:
- `72f713d`: Advance build submodule [Phillip Johnston]

[Pipeline] slackSend
run slackstepsend, step null:false, desc :true
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: true, color: false
[Pipeline] echo
Deleting temporary tag
[Pipeline] sh
[ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q] Running shell script
+ git tag -d 0.1.34
Deleted tag '0.1.34' (was 09e890c)
[Pipeline] sh
[ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q] Running shell script
+ git config --get remote.origin.url
[Pipeline] readFile
[Pipeline] echo
Creating a GitHubPluginConfig for credential 4c01f168-ca25-483e-bc6d-8d105fc5fb70
[Pipeline] echo
Registering GithubProjectProperty for repo URL https://github.com/embeddedartistry/libmemory
[Pipeline] properties

Alternate Freelist Implementation Idea

From #82:

One way around the whole static problem would be to let the user provide the memory for the metadata themselves. That would also make it easier to use libmemory in a multitasking environment without the need for locks (but of course would require some API changes/additions).

I like this idea, but it does require API changes, probably significant enough that it does not really work in this way as a "malloc". We could make the stock malloc APIs work with a single freelist (probably still requiring a lock in this case), but could provide extended APIs that allow callers to allocate memory against a particular freelist. Then each thread can have its own freelist and memory allocation zone.

This has some beneficial properties:

  • no lock needed if each thread provides its own freelist
  • you can portion dynamic memory according to each thread's specific needs
  • you can see how dynamic memory is being used across threads without any real effort put into analytics development - unlike a single heap case

ea-nightly/libmemory/master: #23 Failed

Build ea-nightly/libmemory/master #23 Failed

View full output

Change log:

  • 7977590: Enable ADR for this repository [Phillip Johnston]
  • f2c623e: Add dependency note regarding ADR tools [Phillip Johnston]
  • 76b9489: Delete premake build module [Phillip Johnston]
  • 1c892e9: Add meson build system submodule [Phillip Johnston]
  • a299694: Convert build to Meson [Phillip Johnston]
  • b0e866a: Add RTOS library builds [Phillip Johnston]
  • 3930286: Remove premake build file [Phillip Johnston]
  • 1d8b4fd: Convert add_global_arguments call to add_project_arguments call, since [Phillip Johnston]
  • 3f12543: Use the latest build submodule [Phillip Johnston]
  • c21193e: Add dependencies for external projects, add a native libmemory_freelist [Phillip Johnston]
  • 9c04a5f: Only build tests in native mode [Phillip Johnston]
  • 53f16c4: Enable CPP in libmemory [Phillip Johnston]
  • 62f5743: Advance build submodule [Phillip Johnston]
  • 6231d91: Update to latest build submodule pointer [Phillip Johnston]
  • 91ecda8: Fix build if statement [Phillip Johnston]
  • f9354fd: Create a test header [Phillip Johnston]
  • 0887dba: Fix warnings in test files [Phillip Johnston]
  • 34451fa: Fix linked list warnings [Phillip Johnston]
  • 0b2e584: Fix warnings in malloc source files [Phillip Johnston]
  • e180f9d: Simplify test build [Phillip Johnston]
  • ba0d022: Define a secondary include structure for dependencies, where the [Phillip Johnston]
  • 2939b59: Memory Build Overhaul - Disable stdlib_compiler_flags for library build, [Phillip Johnston]
  • 44ea7d4: Format update [Phillip Johnston]
  • 1ba1498: Add complexity metrics (via lizard) to libmemory [Phillip Johnston]
  • c678ef4: Fix test result generation for libmemory [Phillip Johnston]

Last 75 of output:

[...truncated 12.83 KB...]
stored system data.

To change option values, run meson configure instead.
ninja: no work to do.
[Pipeline] junit
Recording test results
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Documentation)
[Pipeline] sh
[ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q] Running shell script
+ make doc
make: *** No rule to make target `doc'.  Stop.
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Archive)
Stage 'Archive' skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] warnings
[WARNINGS] Skipping publisher since build result is FAILURE
[Pipeline] openTasks
[TASKS] Skipping publisher since build result is FAILURE
[Pipeline] echo
Sending slack message: <http://136.24.14.137:12345/job/ea-nightly/job/libmemory/job/master/23/display/redirect|ea-nightly/libmemory/master #23>: *FAILED*
Changes:
- `7977590`: Enable ADR for this repository [Phillip Johnston]
- `f2c623e`: Add dependency note regarding ADR tools [Phillip Johnston]
- `76b9489`: Delete premake build module [Phillip Johnston]
- `1c892e9`: Add meson build system submodule [Phillip Johnston]
- `a299694`: Convert build to Meson [Phillip Johnston]
- `b0e866a`: Add RTOS library builds [Phillip Johnston]
- `3930286`: Remove premake build file [Phillip Johnston]
- `1d8b4fd`: Convert add_global_arguments call to add_project_arguments call, since [Phillip Johnston]
- `3f12543`: Use the latest build submodule [Phillip Johnston]
- `c21193e`: Add dependencies for external projects, add a native libmemory_freelist [Phillip Johnston]
- `9c04a5f`: Only build tests in native mode [Phillip Johnston]
- `53f16c4`: Enable CPP in libmemory [Phillip Johnston]
- `62f5743`: Advance build submodule [Phillip Johnston]
- `6231d91`: Update to latest build submodule pointer [Phillip Johnston]
- `91ecda8`: Fix build if statement [Phillip Johnston]
- `f9354fd`: Create a test header [Phillip Johnston]
- `0887dba`: Fix warnings in test files [Phillip Johnston]
- `34451fa`: Fix linked list warnings [Phillip Johnston]
- `0b2e584`: Fix warnings in malloc source files [Phillip Johnston]
- `e180f9d`: Simplify test build [Phillip Johnston]
- `ba0d022`: Define a secondary include structure for dependencies, where the [Phillip Johnston]
- `2939b59`: Memory Build Overhaul - Disable stdlib_compiler_flags for library build, [Phillip Johnston]
- `44ea7d4`: Format update [Phillip Johnston]
- `1ba1498`: Add complexity metrics (via lizard) to libmemory [Phillip Johnston]
- `c678ef4`: Fix test result generation for libmemory [Phillip Johnston]

[Pipeline] slackSend
run slackstepsend, step null:false, desc :true
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: true, color: false
[Pipeline] echo
Deleting temporary tag
[Pipeline] sh
[ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q] Running shell script
+ git tag -d 0.1.23
Deleted tag '0.1.23' (was bac383c)
[Pipeline] sh
[ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q] Running shell script
+ git config --get remote.origin.url
[Pipeline] readFile
[Pipeline] echo
Creating a GitHubPluginConfig for credential 4c01f168-ca25-483e-bc6d-8d105fc5fb70
[Pipeline] echo
Registering GithubProjectProperty for repo URL https://github.com/embeddedartistry/libmemory
[Pipeline] properties

ea-ci/libmemory/PR-4-merge: Build failure

Build 'ea-ci/libmemory/PR-4-merge' is failing!

Last 50 lines of build output:

[...truncated 11.99 KB...]
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/malloc_freelist.c:154:56: error: no member named 'block' in 'alloc_node_t'
        blk->size = (uintptr_t)addr + size - (uintptr_t)blk - ALLOC_HEADER_SZ;
                                                              ^~~~~~~~~~~~~~~
../../src/malloc_freelist.c:36:48: note: expanded from macro 'ALLOC_HEADER_SZ'
#define ALLOC_HEADER_SZ offsetof(alloc_node_t, block)
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../dependencies/lib/linkedlist/ll.h:13:56: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) ((size_t) & ((TYPE*)0)->MEMBER)
                                           ~~~~~~~~~~  ^
11 errors generated.
make[2]: *** [obj/x86_64/debug/libmalloc_freelist/malloc_freelist.o] Error 1
make[1]: *** [libmalloc_freelist] Error 2
make: *** [build] Error 2
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Format)
Stage 'Format' skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] echo
Gathering SCM changes
[Pipeline] slackSend
run slackstepsend, step null:false, desc KywGMjF0sBstgPYC2Lqjhzyy:false
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: true, color: false
ERROR: Slack notification failed. See Jenkins logs for details.
[Pipeline] echo
Setting config
[Pipeline] sh
[ea-ci_libmemory_PR-4-merge-BVXPTERKN44OGIX4WIBWAJZW7WZVOKVHFCSQVT3NBJMQUAG2BTFQ] Running shell script
+ git config --get remote.origin.url
[Pipeline] readFile
[Pipeline] echo
Started with URL: https://github.com/embeddedartistry/libmemory.git
[Pipeline] echo
Ended with url: https://github.com/embeddedartistry/libmemory
[Pipeline] echo
GitHubPluginConfig for credential 4c01f168-ca25-483e-bc6d-8d105fc5fb70
[Pipeline] echo
Registering GithubProjectProperty
[Pipeline] properties
[Pipeline] echo
Filing issue (outer)
[Pipeline] echo
Filing GitHub issue for build failure
[Pipeline] step

Changes since last successful build:
No changes

  • [Phillip Johnston] 28da905b35ee31ba0c436cfe6de8585e92d91631 - debug

  • [Phillip Johnston] 6e24d815d5ebde082044c770154e0a5422c8a317 - Fix

  • [Phillip Johnston] 2828e322c262b0f1de4f9a61e71d41cfeeb65a14 - Remove ending

  • [Phillip Johnston] 8761f3c8507211804498a56f8364fa65d80f06c1 - Fix error

View full output

Provide a malloc_addblock() implementation for the libmemory hosted variant

Split from #71

There is no malloc_addblock() in libmemory.a and thus one gets the missing reference error when following the current documentation, which talks a lot about that function but only of linking with libmemory.a. Of course in the case of libmemory.a in a hosted environment one does not strictly need that function and calling it makes not really sense - however, having an implementation anyway would make it possible to share the same code in the user application (and documentation examples, tests etc.) no matter which variant is linked eventually. One easy way to accomplish that would be to add something like:

diff --git a/src/posix_memalign.c b/src/posix_memalign.c
index 996a85e..fa30924 100644
--- a/src/posix_memalign.c
+++ b/src/posix_memalign.c
@@ -1,3 +1,4 @@
+#include <malloc.h>
 #include <aligned_malloc.h>
 #include <assert.h>
 #include <errno.h>
@@ -5,6 +6,10 @@
 
 #define IS_POWER_2(x) (!((x) & ((x)-1)))
 
+__attribute__((weak)) void malloc_addblock(__attribute__((unused)) void* addr, __attribute__((unused)) size_t size)
+{
+}
+
 int posix_memalign(void** __memptr, size_t __alignment, size_t __size)
 {
  int r = ENOMEM;

As I wrote initially, I would add a run-time warning there too to make sure the user understands what is going on (else this is easily missed I guess).

ea-nightly/libmemory/master: #36 Failed

Build ea-nightly/libmemory/master #36 Failed

View full output

Change log:

  • 502ac95: Enable code coverage build in Makefile [Phillip Johnston]
  • dfa5819: Add coverage to Jenkins builds, even though it's currently not running [Phillip Johnston]
  • 3fb4bf3: Add clang-tidy support to the build system [Phillip Johnston]
  • 32c6e61: Add clang-tidy to Jenkins builds [Phillip Johnston]

Last 75 of output:

[...truncated 87 lines...]
FAILED: build.ninja 
/usr/local/opt/python/bin/python3.7 /usr/local/Cellar/meson/0.47.2/libexec/bin/meson --internal regenerate /Users/pjohnston/.jenkins/workspace/ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q /Users/pjohnston/.jenkins/workspace/ea-nightly_libmemory_master-M4PBALY3KARPG4FVHZXTYBYNLQ2KWKVZT546I7CIRFMDFGJHU53Q/buildresults --backend ninja
ninja: error: rebuilding 'build.ninja': subcommand failed
make: *** [libmemory] Error 1
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Test)
Stage "Test" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Complexity)
Stage "Complexity" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (CppCheck)
Stage "CppCheck" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Clang Tidy)
Stage "Clang Tidy" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Clang Analyzer)
Stage "Clang Analyzer" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Coverage)
Stage "Coverage" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Documentation)
Stage "Documentation" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (ScanWorkspace)
Stage "ScanWorkspace" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] echo
Sending slack message: <http://136.24.14.137:12345/job/ea-nightly/job/libmemory/job/master/36/display/redirect|ea-nightly/libmemory/master #36>: *FAILED*
Changes:
- `502ac95`: Enable code coverage build in Makefile [Phillip Johnston]
- `dfa5819`: Add coverage to Jenkins builds, even though it's currently not running [Phillip Johnston]
- `3fb4bf3`: Add clang-tidy support to the build system [Phillip Johnston]
- `32c6e61`: Add clang-tidy to Jenkins builds [Phillip Johnston]

[Pipeline] slackSend
run slackstepsend, step false, desc true
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: true, color: false
[Pipeline] echo
Deleting temporary tag
[Pipeline] sh
+ git tag -d 0.1.36
Deleted tag '0.1.36' (was 8a1b13e)
[Pipeline] sh
+ git config --get remote.origin.url
[Pipeline] readFile
[Pipeline] echo
Creating a GitHubPluginConfig for credential 4c01f168-ca25-483e-bc6d-8d105fc5fb70
[Pipeline] echo
Registering GithubProjectProperty for repo URL https://github.com/embeddedartistry/libmemory
[Pipeline] properties
[Pipeline] echo
Filing GitHub issue for ea-nightly/libmemory/master

Cross-specific flags are ignored by meson

Hi,

I was trying to build libmemory for arm (cortex m4) on top of your libc instead of newlib. To that end, I was editing the cortex m4 configuration file to add the necessary -I directories and add the -nostdlib linker flag for the libc.
To build I have used meson buildresults --cross-file build/cross/arm.txt --cross-file build/cross/cortex-m4_hardfloat.txt and make.
However, this does not work correctly as can be observed by the output of arm-none-eabi-nm buildresults/src/libmemory.a or trying to use the library in a project w/o newlib. The resulting library depends on __assert_func from newlib instead of artistry's __assert_fail.

I then tried to find out what's going on (which took quite a while due to meson, which has officially replaced autotools as my most hated build system by now ;)) and stumbled about a series of bug reports in meson related to this one and I have concluded that this is the problem. In fact, all the settings to cpp_args etc. in the cross files are completely ignored. This is visible when building with meson compile --verbose that prints the command lines.

Eventually, I was successful by directly supplying the required flags as environment variables like so (assuming libc and libmemory are checked out at the same directory level):

CFLAGS="-march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -I$(realpath ../libc/include) -I$(realpath ../libc/arch/arm/include) -I$(realpath ../libc/printf)" LDFLAGS="-L$(realpath ../libc/buildresults/src/)" meson buildresults --cross-file build/cross/arm.txt --cross-file build/cross/cortex-m4_hardfloat.txt

All of this is with up to date repos, meson 0.61.2 and gcc version 7.3.1 20180622 (both from Debian repos).

ea-ci/libmemory/PR-4-merge: #15 failed

Build 'ea-ci/libmemory/PR-4-merge' is failing!

Last 50 lines of build output:

[...truncated 11.25 KB...]
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../dependencies/lib/linkedlist/ll.h:21:42: note: expanded from macro 'container_of'
                (type*)((char*)__mptr - offsetof(type, member));      \
                                        ~~~~~~~~~~~~~~~^~~~~~~
../../dependencies/lib/linkedlist/ll.h:13:56: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) ((size_t) & ((TYPE*)0)->MEMBER)
                                           ~~~~~~~~~~  ^
../../src/malloc_freelist.c:127:7: error: assigning to 'alloc_node_t *' from incompatible type 'void'
                blk = container_of(ptr, alloc_node_t, block);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/malloc_freelist.c:154:56: error: no member named 'block' in 'alloc_node_t'
        blk->size = (uintptr_t)addr + size - (uintptr_t)blk - ALLOC_HEADER_SZ;
                                                              ^~~~~~~~~~~~~~~
../../src/malloc_freelist.c:36:48: note: expanded from macro 'ALLOC_HEADER_SZ'
#define ALLOC_HEADER_SZ offsetof(alloc_node_t, block)
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../dependencies/lib/linkedlist/ll.h:13:56: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) ((size_t) & ((TYPE*)0)->MEMBER)
                                           ~~~~~~~~~~  ^
11 errors generated.
make[2]: *** [obj/x86_64/debug/libmalloc_freelist/malloc_freelist.o] Error 1
make[1]: *** [libmalloc_freelist] Error 2
make: *** [build] Error 2
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Format)
Stage 'Format' skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] echo
Gathering SCM changes
[Pipeline] slackSend
run slackstepsend, step null:false, desc KywGMjF0sBstgPYC2Lqjhzyy:false
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: true, color: false
[Pipeline] sh
[ea-ci_libmemory_PR-4-merge-BVXPTERKN44OGIX4WIBWAJZW7WZVOKVHFCSQVT3NBJMQUAG2BTFQ] Running shell script
+ git config --get remote.origin.url
[Pipeline] readFile
[Pipeline] echo
Creating a GitHubPluginConfig for credential 4c01f168-ca25-483e-bc6d-8d105fc5fb70
[Pipeline] echo
Registering GithubProjectProperty for repo URL https://github.com/embeddedartistry/libmemory
[Pipeline] properties
[Pipeline] echo
Filing GitHub issue with build status: $status
[Pipeline] step

Changes since last successful build:
No changes

  • [Phillip Johnston] 28da905b35ee31ba0c436cfe6de8585e92d91631 - debug

  • [Phillip Johnston] 6e24d815d5ebde082044c770154e0a5422c8a317 - Fix

  • [Phillip Johnston] 2828e322c262b0f1de4f9a61e71d41cfeeb65a14 - Remove ending

  • [Phillip Johnston] 8761f3c8507211804498a56f8364fa65d80f06c1 - Fix error

No changes

  • [Phillip Johnston] fff4c7ee774fd850e6654935eaa7f730133648cc - Support filing Github issues on build failures

  • [Phillip Johnston] 7984154f7df33e32707f055587ce0ffa081600b3 - Add documentation for new commands

  • [Phillip Johnston] 0b87229 - Try

  • [Phillip Johnston] bd9d7dc - try

  • [Phillip Johnston] 785d66177227625a77fd20dda64a8eb2d6a6872b - Add slackSend step to a try/catch block. Slack failures shouldn't stop

  • [Phillip Johnston] 45f934f4b4e683919d1175de0705f908d5fb6b0c - try

  • [Phillip Johnston] 80dd38ae78a4ad5acd44b72833a5fe4e952c8edb - try 2

  • [Phillip Johnston] 92de4fe6b5059c1cc7e1e81e00e6e1fed7fb8dc9 - Tr

No changes
No changes

  • [Phillip Johnston] c78aae6 - wip

  • [Phillip Johnston] 1b85960 - try

  • [Phillip Johnston] fe4d277 - fix

  • [Phillip Johnston] d643428 - try

  • [Phillip Johnston] 8de8440 - try

  • [Phillip Johnston] 77685d4 - try

  • [Phillip Johnston] 52b0b5c49a39015ae2532b2c51b01556e54faf81 - wip

  • [Phillip Johnston] 96cb9c581b141f1bb94f4a5847a9adb74bce5650 - Try

  • [Phillip Johnston] 098a77d1b219acf132f41de70ef7a764540e0dd9 - Try

  • [Phillip Johnston] 8cd2ef8627388c586fe0370ab19fa02e6d6ce7ed - try

  • [Phillip Johnston] d0def7b22b1f4d5084fa51c179fdc88bb51529b4 - try

  • [Phillip Johnston] 39112bfd7f83472aea6c473f4f208448aacfc21a - Try

  • [Phillip Johnston] dc1dfab26c0865870fb916f3e5571cb70b516f27 - try

  • [Phillip Johnston] 98f6da26635fc3c772dc8e11737a93e21905f16e - try

  • [Phillip Johnston] f6af3014923c6422e24580122b3259293a6c8de6 - try

  • [Phillip Johnston] ebf73f23f19202c4d12b5391a53e82a810986583 - WIP

  • [Phillip Johnston] dc7af3927fb9688bfaedaa519a9e504b63133265 - wip

  • [Phillip Johnston] 3dda35bd463e7c93e625834ab0ecd305eac362dd - Big changes

  • [Phillip Johnston] 839fa293b3fdc6c38a45c78e9e8a055eb5a109fa - WIP

  • [Phillip Johnston] 3eece3b8e7a29c7c221d90bd2d8cf79274e60e54 - Try

  • [Phillip Johnston] a5da3d1ce14bd6cbca73422d3a90d86d4af999ab - Try

  • [Phillip Johnston] c0cd7219514ca698921be926f78e3d2e497bb131 - try

  • [Phillip Johnston] 5f8b815cddd24ae9e7eca630454060bdd8638d84 - Try

  • [Phillip Johnston] e833b6488bf32f8db60a4046e28c344e9a82d0f0 - try

  • [Phillip Johnston] d2be14d6e941a9396d17a27d139c850fc4872908 - try

  • [Phillip Johnston] 384c1b5e4de093cd1daff4631a128e5216a7c626 - try

  • [Phillip Johnston] 82ab2e0 - Wip

  • [Phillip Johnston] e12857b - File github issue on nightly build failure

  • [Phillip Johnston] 91a708744598e1f6e8477e2605577f9cb6302d68 - Clearer text for issue filing

  • [Phillip Johnston] 82ab2e0 - Wip

  • [Phillip Johnston] e12857b - File github issue on nightly build failure

View full output

Better documentation of variants/usage

NB: I am a first-time user who checked out the repo less than an hour ago.

The current documentation leaves the reader quite in the dark regarding the different versions that a default build creates AFAICT. Currently, there are 10 different static libraries produced and only very few related bits are explained (e.g., that there exists a ThreadX implementation). What's more, the bit that explains how to "install" the library explains that one should link with -Lpath/to/libmemory.a -lmemory, i.e. libmemory.a. However, that apparently does only add the aligned_ functions(?) Therefore, when trying a typical example project that calls malloc_addblock() as explained in the actual Usage Section the user is greeted with undefined reference to malloc_addblock'` and ponders why.

Apart from expanding the documentation it might be a good idea to add a default implementation of malloc_addblock() that is either just a nop, or fprints a warning at runtime (if not disabled by some build option or so)?

PS: make help shows a tests target. I think that should be just test

Support C11 free()

With aligned_alloc() in the C11 standard, free() is called to free memory, rather than an equivalent aligned_free().

We should update our library with some logic that can be used to correctly call aligned_free() if free() is used instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.