]> git.ipfire.org Git - thirdparty/git.git/commit
mem-pool: simplify alignment calculation
authorRené Scharfe <l.s.r@web.de>
Sun, 24 Dec 2023 17:02:04 +0000 (18:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Dec 2023 20:22:58 +0000 (12:22 -0800)
commitc61740d6078b6da6219779844cfdd74ed430fb80
treec57b1ce285c09fd5d5d36167778de2304306e441
parent6cbae640006c3a9e1bb22654a8def7f4bef775b3
mem-pool: simplify alignment calculation

Use DIV_ROUND_UP in mem_pool_alloc() to round the allocation length to
the next multiple of GIT_MAX_ALIGNMENT instead of twiddling bits
explicitly.  This is shorter and clearer, to the point that we no longer
need the comment that explains what's being calculated.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mem-pool.c