Skip to content

Commit

Permalink
valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazuh committed Nov 14, 2023
1 parent 7ab7a03 commit 18c70b5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Install Valgrind
run: sudo apt-get install valgrind -y

- name: Make
run: cc -v && make
run: gcc --version && make valgrind
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ SRC= $(SRC_FOLDER)/$(SRC_MAIN)

BIN_FOLDER = ./build
BIN = $(BIN_FOLDER)/hashtables.bin
DEBUG_BIN = $(BIN_FOLDER)/hashtables-debug.bin

.PHONY=default build run clean
.PHONY=default build run clean valgrind

default: clean run

Expand All @@ -21,3 +22,8 @@ run: build

clean:
rm -rf $(BIN_FOLDER)

valgrind:
mkdir -p $(BIN_FOLDER)
gcc $(SRC) -Wall -pedantic -g -ggdb -O0 -std=c18 -o $(DEBUG_BIN)
valgrind $(DEBUG_BIN)
2 changes: 1 addition & 1 deletion src/hashtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ unsigned long hash_str_djb2(char *raw_string)
}

return hash_value;
};
}

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

0 comments on commit 18c70b5

Please sign in to comment.