From 40e6e661cb07556d775bbe0addcd51ac3c3a38d4 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 27 Oct 2014 23:34:17 -0700 Subject: [PATCH] Fixing round_up, which was breaking physical alloc alignment. --- src/poly/math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/poly/math.h b/src/poly/math.h index 2bd43619c..0fbbb0702 100644 --- a/src/poly/math.h +++ b/src/poly/math.h @@ -36,7 +36,7 @@ T align(T value, T alignment) { // Rounds the given number up to the next highest multiple. template T round_up(T value, V multiple) { - return value + multiple - 1 - (value - 1) % multiple; + return value ? (value + multiple - 1 - (value - 1) % multiple) : multiple; } inline float saturate(float value) {