Fix typo in function name.
[SXSI/libbp.git] / bp-utils.h
index b548688..21aa7d3 100644 (file)
@@ -36,7 +36,25 @@ static inline unsigned int popcount8(unsigned int n) {
 }
 
 #else
+#ifdef HAS_POPCOUNT_TABLE
+
+extern unsigned char popCount[256];
 
+static unsigned int popcount8(unsigned int x)
+{
+  return (unsigned int) popCount[x & 0xff];
+}
+
+static unsigned int popcount(unsigned int x)
+{
+  return popcount8(x) +
+    popcount8((x >> 8)) +
+    popcount8((x >> 16)) +
+    popcount8((x >> 24));
+}
+
+
+#else
 static unsigned int popcount8(unsigned int x)
 {
   unsigned int r;
@@ -58,6 +76,7 @@ static inline unsigned int popcount(unsigned int x)
 }
 
 #endif
+#endif
 
 
 void * bp_malloc(size_t);
@@ -68,7 +87,7 @@ void * bp_malloc(size_t);
 
 void bp_free(void *);
 
-size_t bp_alloc_stats(void);
+size_t bp_get_alloc_stats(void);
 
 void bp_reset_alloc_states(void);