Skip to content

Commit 18c70b5

Browse files
committed
valgrind
1 parent 7ab7a03 commit 18c70b5

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/clang.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v3
15+
16+
- name: Install Valgrind
17+
run: sudo apt-get install valgrind -y
18+
1519
- name: Make
16-
run: cc -v && make
20+
run: gcc --version && make valgrind

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ SRC= $(SRC_FOLDER)/$(SRC_MAIN)
77

88
BIN_FOLDER = ./build
99
BIN = $(BIN_FOLDER)/hashtables.bin
10+
DEBUG_BIN = $(BIN_FOLDER)/hashtables-debug.bin
1011

11-
.PHONY=default build run clean
12+
.PHONY=default build run clean valgrind
1213

1314
default: clean run
1415

@@ -21,3 +22,8 @@ run: build
2122

2223
clean:
2324
rm -rf $(BIN_FOLDER)
25+
26+
valgrind:
27+
mkdir -p $(BIN_FOLDER)
28+
gcc $(SRC) -Wall -pedantic -g -ggdb -O0 -std=c18 -o $(DEBUG_BIN)
29+
valgrind $(DEBUG_BIN)

src/hashtables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ unsigned long hash_str_djb2(char *raw_string)
2222
}
2323

2424
return hash_value;
25-
};
25+
}
2626

2727
/**
2828
* @brief Internal data structure, each bucket is a row in the hash table powering the HashStrSet.

0 commit comments

Comments
 (0)