utils.[ch]: add fence_get_page_size()
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 8 Sep 2015 06:36:48 +0000 (09:36 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 9 Sep 2015 08:30:51 +0000 (11:30 +0300)
commite9ef2cc4dea04792a03d604c075c344055765217
treedd3ab9c0bca46e82444a0e257335f79264f5625f
parent82f8c997dfd3f60a48134107ecf38663b464bdc9
utils.[ch]: add fence_get_page_size()

Add a function to get the page size used for memory fence purposes, and
use it everywhere where getpagesize() was used.

This offers a single point in code to override the page size, in case
one wants to experiment how the tests work with a higher page size than
what the developer's machine has.

This also offers a clean API, without adding #ifdefs, to tests for
checking the page size.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Ben Avison <bavison@riscosopen.org>
test/utils.c
test/utils.h