From: Dave Airlie Date: Wed, 4 Feb 2009 03:16:41 +0000 (+1000) Subject: radeon: call getpagesize once and store in a static X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e44effcfcba4591a622e47ee1b4807ddf5789d51;p=mesa.git radeon: call getpagesize once and store in a static --- diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index 993bac81243..a716f1059b9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c @@ -260,7 +260,10 @@ static struct bo_legacy *bo_allocate(struct bo_manager_legacy *boml, uint32_t flags) { struct bo_legacy *bo_legacy; - uint32_t pgsize = getpagesize() - 1; + static int pgsize; + + if (pgsize == 0) + pgsize = getpagesize() - 1; size = (size + pgsize) & ~pgsize;