Compare commits

...

2 Commits

Author SHA1 Message Date
46fd8a30bc day 18: improve tree structure explanation 2022-01-14 11:49:23 +01:00
77ef1fa003 Makefile day 19: added memcheck targets 2022-01-14 11:48:47 +01:00
2 changed files with 19 additions and 10 deletions

View File

@@ -24,15 +24,16 @@
*
* Example, [1,[4,2]] is represented as :
*
* ------> SN root <-------------- Depth: 0
* | / \ |
* LL| / \ |
* | / \ |LL
* --> 1 <--- SN node | Depth: 1
* | / \ |
* | / \ |
* LL---> 4 <-------> 2 <-- Depth: 2
* LL
* +-------> SN root <---------------+ Depth: 0
* | / \ |
* |LL / \ |
* | / \ |LL
* +---> 1 <--+ SN node | Depth: 1
* | / \ |
* |LL / \ |
* | / \ |
* +--> 4 <-------> 2 <---+ Depth: 2
* LL
*/
static pool_t *pool_nodes;

View File

@@ -40,10 +40,18 @@ CFLAGS += -DDEBUG_POOL # memory pools management
TIME := \time -f "\ttime: %E real, %U user, %S sys\n\tcontext-switch:\t%c+%w, page-faults: %F+%R\n"
export PATH := .:$(PATH)
.PHONY: clean all compile ex1 ex2
.PHONY: clean all compile memcheck memcheck1 memcheck2 ex1 ex2
all: ex1 ex2
memcheck: memcheck1 memcheck2
memcheck1:
@valgrind -q -s --track-origins=yes aoc-c -p 1 < $(INPUT)
memcheck2:
@valgrind -q -s --track-origins=yes aoc-c -p 2 < $(INPUT)
compile: aoc-c
ex1: aoc-c