[gnome-builder] portability: use sysconf(3) to get PAGE_SIZE



commit a7508c8c8b61d1f9c4735021a4e3dcd952dd7fef
Author: Antoine Jacoutot <ajacoutot gnome org>
Date:   Tue Apr 14 09:43:14 2015 +0200

    portability: use sysconf(3) to get PAGE_SIZE
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747826

 libide/ide-highlight-index.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-highlight-index.c b/libide/ide-highlight-index.c
index 1c92119..6ed2770 100644
--- a/libide/ide-highlight-index.c
+++ b/libide/ide-highlight-index.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/user.h>
+#include <unistd.h>
 
 #include "ide-debug.h"
 #include "ide-highlight-index.h"
@@ -47,7 +48,7 @@ ide_highlight_index_new (void)
 
   ret = g_new0 (IdeHighlightIndex, 1);
   ret->ref_count = 1;
-  ret->strings = g_string_chunk_new (PAGE_SIZE);
+  ret->strings = g_string_chunk_new (sysconf (_SC_PAGE_SIZE));
   ret->index = g_hash_table_new (g_str_hash, g_str_equal);
 
   return ret;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]