X-Git-Url: http://git.nguyen.vg/gitweb/?p=SXSI%2Flibbp.git;a=blobdiff_plain;f=bp-utils.c;fp=bp-utils.c;h=0fc7a42e5b67f204697474812606e6c25fa2b0be;hp=b1d68ce071e9b28edcb9e09b2f347f2680b5ade6;hb=7e784b76fbed5924499b586bedeb51057f62e05f;hpb=45ff7a2260f890f6ef6a7b56f654ffa1a057a7e7 diff --git a/bp-utils.c b/bp-utils.c index b1d68ce..0fc7a42 100644 --- a/bp-utils.c +++ b/bp-utils.c @@ -1,6 +1,27 @@ #include #include "bp-utils.h" +unsigned char popCount[] = { + 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4, + 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, + 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, + 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, + 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, + 4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8 +}; + + + static size_t allocated = 0; void * bp_malloc(size_t n)