After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747826 - portability: use sysconf(3) to get PAGE_SIZE
portability: use sysconf(3) to get PAGE_SIZE
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
3.16.x
Other OpenBSD
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-14 07:45 UTC by Antoine Jacoutot
Modified: 2015-04-14 08:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use sysconf(3) to get PAGE_SIZE (964 bytes, patch)
2015-04-14 07:45 UTC, Antoine Jacoutot
accepted-commit_now Details | Review

Description Antoine Jacoutot 2015-04-14 07:45:42 UTC
Created attachment 301510 [details] [review]
use sysconf(3) to get PAGE_SIZE

Hi.

PAGE_SIZE is not declared on (at least) OpenBSD.

libide/ide-highlight-index.c: In function 'ide_highlight_index_new':
libide/ide-highlight-index.c:50:38: error: 'PAGE_SIZE' undeclared (first use in this function)
   ret->strings = g_string_chunk_new (PAGE_SIZE);

AFAIK, sysconf(3) is a more portable way to get it.
Thoughts?
Comment 1 Christian Hergert 2015-04-14 08:18:46 UTC
Review of attachment 301510 [details] [review]:

LGTM.

I wonder if long term we should at a small platform abstraction for this type of stuff. I'm surprised we have g_get_num_processors() but not g_get_page_size or similar.
Comment 2 Antoine Jacoutot 2015-04-14 08:31:46 UTC
Thank you Christian. It's in (a7508c8c8b61d1f9c4735021a4e3dcd952dd7fef).
Side note, yes something like g_get_page_size() could be of interest I think.