Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "shmalloc"]
path = shmalloc
url = https://github.com/MihirLuthra/shmalloc.git
[submodule "shm_alloc"]
path = shm_alloc
url = https://github.com/MihirLuthra/shm_alloc.git
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CC=clang

CFLAGS= -D DEBUG_SHM=0 -I shm_alloc -Wall -D USE_SHARED_MEMORY -D DEBUG_DIR=\"debug\" -fsanitize=address

ctrie_multiprocess_test.out: ctrie_multiprocess_test.c libctrie.so Makefile libshm_alloc.so
$(CC) $(CFLAGS) -o $@ ctrie_multiprocess_test.c -L. -lctrie -lshm_alloc

libctrie.so: ctrie.c ctrie.h libshm_alloc.so
$(CC) $(CFLAGS) -fPIC -shared -o $@ ctrie.c -L. -Lshm_alloc -lc -lshm_alloc

libshm_alloc.so: shm_alloc/shm_alloc.c shm_alloc/shm_alloc.h shm_alloc/shm_err.h libshm_util_funcs.so libshm_debug.so libshm_constants.so Makefile
$(CC) $(CFLAGS) -fPIC -shared -o $@ shm_alloc/shm_alloc.c -lc -L. -lshm_util_funcs -lshm_constants -lshm_debug

libshm_debug.so: shm_alloc/shm_debug.h shm_alloc/shm_debug.c Makefile
$(CC) $(CFLAGS) -fPIC -shared -o $@ shm_alloc/shm_debug.c -lc

libshm_util_funcs.so: shm_alloc/shm_util_funcs.h shm_alloc/shm_util_funcs.c libshm_constants.so libshm_debug.so shm_alloc/shm_types.h Makefile
$(CC) $(CFLAGS) -fPIC -shared -o $@ shm_alloc/shm_util_funcs.c -lc -L. -lshm_constants -lshm_debug

libshm_constants.so: shm_alloc/shm_constants.h shm_alloc/shm_constants.c Makefile
$(CC) $(CFLAGS) -fPIC -shared -o $@ shm_alloc/shm_constants.c -lc

clean:
rm *.so shm_file *.out .*.swp *.dbgfl
6 changes: 3 additions & 3 deletions ctrie.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
#include <stdint.h>

#if defined(USE_SHARED_MEMORY)
#include <shmalloc.h>
#include <shm_alloc.h>

#define PTR(type) size_t
#define DEREF(ptr, output_type) (*((output_type*) (((char*) shm_base()) + ptr)))
#define PTR(type) shm_offt
#define DEREF(ptr, output_type) (*((output_type*) (((char*) get_shm_user_base()) + ptr)))
#else /* defined(USE_SHARED_MEMORY) */
#define PTR(type) type*
#define DEREF(ptr, output_type) (*((output_type*) ptr))
Expand Down
1 change: 1 addition & 0 deletions shm_alloc
Submodule shm_alloc added at 0e01b1
1 change: 0 additions & 1 deletion shmalloc
Submodule shmalloc deleted from c7a4e7