summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-03-10 01:06:24 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-14 23:52:25 +0200
commit58d06cf120eb9bb9247bb807bb105981bb3482a8 (patch)
tree26cab255dc526cd39b0b6f7adf7a7bfc565ad432 /src/util.h
parent71db842fac3ba8582255bc5b61361ddef08ef105 (diff)
downloadlibgit2-58d06cf120eb9bb9247bb807bb105981bb3482a8.tar.gz
Rewrite the Pack backend
The new pack backend is an adaptation of the original git.git code in `sha1_file.c`. It's slightly faster than the previous version and severely less memory-hungry. The call-stack of a normal pack backend query has been properly documented in the top of the header for future reference. And by properly I mean with ASCII diagrams 'n shit.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index fab93c1c2..e0dfd7b20 100644
--- a/src/util.h
+++ b/src/util.h
@@ -2,6 +2,8 @@
#define INCLUDE_util_h__
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
+#define bitsizeof(x) (CHAR_BIT * sizeof(x))
+#define MSB(x, bits) ((x) & (~0ULL << (bitsizeof(x) - (bits))))
/*
* Don't wrap malloc/calloc.