I recently had to use the sbrk() function in c and i had to calcul the size that i'll use for allocate spaces in memory. After some researches i found this line of code:
size_t calc_size = ((size) + ((4096) - 1)) & ~((4096) - 1);
Despite my searches for understand what the operators "~" and "&" means, i have a mean level in c and i could not find clear explanations, precisely for the ~ operator. Could you help me to understand what operation is being performed ?