GNOME Bugzilla – Bug 747826
portability: use sysconf(3) to get PAGE_SIZE
Last modified: 2015-04-14 08:31:46 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?
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.
Thank you Christian. It's in (a7508c8c8b61d1f9c4735021a4e3dcd952dd7fef). Side note, yes something like g_get_page_size() could be of interest I think.