33void rs_bzero(
void *buf,
size_t size)
38void *rs_alloc_struct0(
size_t size,
char const *name)
42 if (!(p = malloc(size))) {
43 rs_fatal(
"couldn't allocate instance of %s", name);
49void *rs_alloc(
size_t size,
char const *name)
53 if (!(p = malloc(size))) {
54 rs_fatal(
"couldn't allocate instance of %s", name);
60void *rs_realloc(
void *ptr,
size_t size,
char const *name)
64 if (!(p = realloc(ptr, size))) {
65 rs_fatal(
"couldn't reallocate instance of %s", name);
70int rs_long_ln2(rs_long_t v)
75 for (n = 0; (v >>= 1); n++) ;
79int rs_long_sqrt(rs_long_t v)
84 for (b = 1, n = v; (n >>= 2); b <<= 1) ;
86 for (n = 0; b; b >>= 1) {
Public header for librsync.
Misc utility functions used by librsync.