Skip to content

Commit

Permalink
feat: support apple Darwin os && add tcl test for Darwin os
Browse files Browse the repository at this point in the history
Signed-off-by: weedge <weege007@gmail.com>
  • Loading branch information
weedge committed Sep 5, 2023
1 parent 0d31eae commit 6a22719
Show file tree
Hide file tree
Showing 5 changed files with 543 additions and 7 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ifeq ($(ENABLE_SANITIZE),YES)
SANITIZE_CFLAGS=-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope
SANITIZE_LDLAGS=-fsanitize=address -lasan
endif
OPTIMIZE_CFLAGS=-O0
OPTIMIZE_CFLAGS=-O1
endif
# find the OS
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
Expand All @@ -83,7 +83,11 @@ else
-fPIC -W -Wall -dynamic -fno-common -g -ggdb -std=gnu99 \
-D_GNU_SOURCE \
-pthread -fvisibility=hidden
SHOBJ_LDFLAGS ?= -fPIC -bundle -undefined dynamic_lookup \
ifeq ($(ENABLE_SANITIZE),YES)
LD=clang
SANITIZE_LDLAGS=-fsanitize=address
endif
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup \
$(SANITIZE_LDLAGS) \
-keep_private_externs
endif
Expand Down
3 changes: 0 additions & 3 deletions module.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,6 @@ int SlotsRestore_RedisCommand(RedisModuleCtx* ctx, RedisModuleString** argv,
return SlotsRestoreAsyncBlock_RedisCommand(ctx, argv, argc);
}

/* Use automatic memory management. */
RedisModule_AutoMemory(ctx);

if (argc < 4 || (argc - 1) % 3 != 0)
return RedisModule_WrongArity(ctx);

Expand Down
2 changes: 1 addition & 1 deletion redisxslot.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,11 +850,11 @@ static int delKeys(RedisModuleCtx* ctx, RedisModuleString* keys[], int n) {
void FreeDumpObjs(RedisModuleCtx* ctx, rdb_dump_obj** objs, int n) {
for (int i = 0; i < n; i++) {
if (objs[i] != NULL) {
RedisModule_Free(objs[i]);
if (objs[i]->val != NULL) {
RedisModule_FreeString(ctx, objs[i]->val);
objs[i]->val = NULL;
}
RedisModule_Free(objs[i]);
objs[i] = NULL;
}
}
Expand Down
Loading

0 comments on commit 6a22719

Please sign in to comment.