lru cache now works as intended
This commit is contained in:
parent
8c1f4f5ee2
commit
5455449bf9
5 changed files with 54 additions and 29 deletions
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef _UTIL_H
|
||||
#define _UTIL_H
|
||||
|
||||
|
||||
#define ERROR(expr, ret, ...) if (expr) { __VA_ARGS__; return ret; }
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
void * emalloc(unsigned long int size);
|
||||
|
|
@ -18,4 +17,18 @@ void print_byte(unsigned char byte);
|
|||
void stopwatch_start(void);
|
||||
double stopwatch_get(void);
|
||||
|
||||
#define TIME_SEC(f) \
|
||||
{ \
|
||||
stopwatch_start(); \
|
||||
f; \
|
||||
printf("\"%s\" took %f seconds", #f, stopwatch_get()); \
|
||||
}
|
||||
|
||||
#define TIME_MS(f) \
|
||||
{ \
|
||||
stopwatch_start(); \
|
||||
f; \
|
||||
printf("\"%s\" took %f ms", #f, stopwatch_get()*1000.0f); \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue