Skip to content

Add a build option that can be used to override the free list static declaration#86

Merged
phillipjohnston merged 1 commit intomasterfrom
pj/config
Apr 5, 2022
Merged

Add a build option that can be used to override the free list static declaration#86
phillipjohnston merged 1 commit intomasterfrom
pj/config

Conversation

@phillipjohnston
Copy link
Member

Fixes #84

Example Output from a manual test case

Default, with a test case that tries to access the list in another file:

[2/2] Linking target test/libmemory_freelist_test
FAILED: test/libmemory_freelist_test
cc  -o test/libmemory_freelist_test test/libmemory_freelist_test.p/main.c.o test/libmemory_freelist_test.p/support_memory.c.o test/libmemory_freelist_test.p/src_aligned_malloc.c.o test/libmemory_freelist_test.p/src_malloc_freelist.c.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -Wl,-rpath,@loader_path/../subprojects/cmocka-1.1.5/src subprojects/cmocka-1.1.5/src/libcmocka_native.0.dylib src/libmemory_freelist_native.a
Undefined symbols for architecture x86_64:
  "_free_list", referenced from:
      _malloc_test in src_malloc_freelist.c.o

After $ make OPTIONS=-Dfreelist-declared-static=false, the application will link successfully and we can iterate over the free list.

@phillipjohnston
Copy link
Member Author

cc @stefanct

@phillipjohnston phillipjohnston merged commit 3859062 into master Apr 5, 2022
@phillipjohnston phillipjohnston deleted the pj/config branch April 5, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a configuration option that removes the static declaration on the freelist

1 participant