Skip to content

Commit 5bd3fd0

Browse files
committed
Adding memory leakage test commands
1 parent 3bbbff8 commit 5bd3fd0

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,6 @@ tools/datagen/src/imgs/*_sobel_*
231231

232232
# Ignore VCD files
233233
*.vcd
234-
test
234+
test
235+
*.zst
236+
.vscode

modules/Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ TARGET?=test
33

44
# Compiler
55
CC=g++
6-
CFLAGS=-Wall -I. -O3 -g -Wextra -Wunused-function
6+
CFLAGS=-Wall -Wextra -fsanitize=address -fsanitize=undefined -I. -O3 -g
77

88
ifdef USE_CPP17
99
CFLAGS+=-std=c++17
1010
endif # USE_CPP17
1111

1212
# Target
1313
LD=g++
14-
LFLAGS=-Wall -I. -lm -g
14+
LFLAGS=-Wall -fsanitize=address -fsanitize=undefined -I. -lm -g
1515
LIBS=-lsystemc -lm
1616

1717
# Source directories
@@ -70,6 +70,15 @@ $(OBJECTS): $(OBJDIR)/%.o : %.cpp
7070
@$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
7171
endif # USING_TLM_TB_EN
7272

73+
valgrind:
74+
valgrind --leak-check=full -s ./$(TARGET)
75+
76+
drmemory:
77+
drmemory -- ./$(TARGET)
78+
79+
heaptrack:
80+
heaptrack ./$(TARGET)
81+
7382
.PHONY: clean
7483
clean:
7584
@rm -rf obj

0 commit comments

Comments
 (0)