From b47c96ec1e8b1dee4a926a950852b2a4c12b4976 Mon Sep 17 00:00:00 2001 From: Mihir Luthra <1999mihir.luthra@gmail.com> Date: Mon, 16 Dec 2019 19:05:23 +0530 Subject: [PATCH 1/4] remove shmalloc submodule --- .gitmodules | 3 --- shmalloc | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 shmalloc diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ccbbc41..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "shmalloc"] - path = shmalloc - url = https://github.com/MihirLuthra/shmalloc.git diff --git a/shmalloc b/shmalloc deleted file mode 160000 index c7a4e73..0000000 --- a/shmalloc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c7a4e73e36b707124004489877c8a476b2bd6547 From 2b0e7f51015460a3c915657e4444bc8fafc19cc7 Mon Sep 17 00:00:00 2001 From: Mihir Luthra <1999mihir.luthra@gmail.com> Date: Mon, 16 Dec 2019 19:18:33 +0530 Subject: [PATCH 2/4] update names according to new shm_alloc module --- .gitmodules | 3 +++ ctrie.h | 6 +++--- shm_alloc | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .gitmodules create mode 160000 shm_alloc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3059a39 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "shm_alloc"] + path = shm_alloc + url = https://github.com/MihirLuthra/shm_alloc.git diff --git a/ctrie.h b/ctrie.h index f9b269f..f729b9e 100644 --- a/ctrie.h +++ b/ctrie.h @@ -33,10 +33,10 @@ #include #if defined(USE_SHARED_MEMORY) -#include +#include -#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)) diff --git a/shm_alloc b/shm_alloc new file mode 160000 index 0000000..b17aa2b --- /dev/null +++ b/shm_alloc @@ -0,0 +1 @@ +Subproject commit b17aa2b472c31b7549df6939a1b25af496df7da1 From 9f9f5b00c4145ce1f163c431025f708503fb5bfe Mon Sep 17 00:00:00 2001 From: Mihir Luthra <1999mihir.luthra@gmail.com> Date: Mon, 16 Dec 2019 19:19:08 +0530 Subject: [PATCH 3/4] add Makefile to build as well --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..abc886b --- /dev/null +++ b/Makefile @@ -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 From c81b20270de56ac96fefb1669944da564691ea1c Mon Sep 17 00:00:00 2001 From: Mihir Luthra <1999mihir.luthra@gmail.com> Date: Mon, 16 Dec 2019 19:38:31 +0530 Subject: [PATCH 4/4] update submodule to latest commit --- shm_alloc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shm_alloc b/shm_alloc index b17aa2b..0e01b1c 160000 --- a/shm_alloc +++ b/shm_alloc @@ -1 +1 @@ -Subproject commit b17aa2b472c31b7549df6939a1b25af496df7da1 +Subproject commit 0e01b1ce9e13f8baedf94cdece6bf5140901728d