2020 day 22: release memory
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
ex1.bash: res=31314
|
||||
time: 0:00.07 real, 0.06 user, 0.00 sys
|
||||
context-switch: 2+1, page-faults: 0+168
|
||||
|
||||
ex2.bash: res=32760
|
||||
time: 1:21.92 real, 81.89 user, 0.01 sys
|
||||
context-switch: 462+1, page-faults: 0+5135
|
||||
|
@@ -13,13 +13,13 @@
|
||||
#include "pool.h"
|
||||
|
||||
typedef struct card {
|
||||
u8 card; /* card value */
|
||||
struct list_head list; /* list of cards */
|
||||
u8 card; /* card value */
|
||||
struct list_head list; /* list of cards */
|
||||
} card_t;
|
||||
|
||||
typedef struct player {
|
||||
int ncards; /* player cards # */
|
||||
struct list_head head; /* head of cards list */
|
||||
int ncards; /* player cards # */
|
||||
struct list_head head; /* head of cards list */
|
||||
} player_t;
|
||||
|
||||
/* zobrist hash used to find duplicate positions
|
||||
@@ -309,5 +309,7 @@ int main(int ac, char **av)
|
||||
long res = part == 1 ? part1(players): part2(players);
|
||||
|
||||
printf("%s : res=%ld\n", *av, res);
|
||||
pool_destroy(pool_hash);
|
||||
pool_destroy(pool_cards);
|
||||
exit(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user