tree-based bootmem
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · In my bootmem patch, I wrote:
Quoted 2 lines
#define
DIV_DN(x,n)(RND_DN(x,n)/ (n))
#defineDIV_UP(x,n)(RND_UP(x,n)/ (n))
Quoted 9 lines · On Sun, Nov 18, 2001 at 12:58:19AM -0000, [email protected] wrote:
Eww. I realize it's not performance-critical, but how about the simpler
#defineDIV_DN(x,n)((x) / (n))
#defineDIV_UP(x,n)DIV_DN((x)+(n)-1, n)There are some alternate definitions of
RND_UPavailable, as well:
#defineRND_UP(x,n)(-RND_DN(-(x),n))
or
#defineRND_UP(x,n)(~(~(x) | (n)-1))
I hope you don't mind my Cc:'ing lkml in my reply.
These are both excellent points. In the interest of economy of CPU, I will follow your suggestions in the next installment (and list you in the changelog =).
Thanks,
Bill