4 static size_t allocated = 0;
6 void * bp_malloc(size_t n)
8 void * res = malloc(n);
10 fprintf(stderr, __FILE__ ": failure to allocate %lu bytes\n", n);
17 void bp_free(void * p)
21 size_t bp_get_alloc_stats(void)
25 void bp_reset_alloc_states(void)
30 int bp_setbit(unsigned int *B, int i,int x)
36 if (x==0) B[j] &= (~(1<<(D-1-l)));
37 else if (x==1) B[j] |= (1<<(D-1-l));
39 printf("error setbit x=%d\n",x);
45 int bp_setbits(unsigned int *B, int i, int d, int x)
50 bp_setbit(B,i+j,(x>>(d-j-1))&1);