This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: locale files and page size
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 27 Sep 2013 00:22:22 +0000
- Subject: Re: locale files and page size
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1309110136100 dot 18202 at digraph dot polyomino dot org dot uk> <20130924225409 dot 323A52C099 at topped-with-meat dot com>
On Tue, 24 Sep 2013, Roland McGrath wrote:
> It would be great to see someone do that analysis and produce some
> interesting data. But that's a lot of work for a pretty small issue.
> We know that the most common affected configurations (i.e. ILP32 with
> 4k pages) will be unchanged by just hard-coding the in-file alignment
> to 4k in localedef. So I would not object to doing that in the
> absence of actual analysis.
This patch does just that, using constant 4096 as page size. Tested
x86_64 and x86.
2013-09-26 Joseph Myers <joseph@codesourcery.com>
* locale/programs/locarchive.c (add_locale): Use constant 4096 for
page size instead of calling getpagesize.
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index 13dba0f..ba164a4 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -838,7 +838,10 @@ add_locale (struct locarhandle *ah,
off64_t lastoffset;
char *ptr;
struct locale_category_data *size_order[__LC_LAST];
- const size_t pagesz = getpagesize ();
+ /* Page size alignment is a minor optimization for locality; use a
+ common value here rather than making the localedef output depend
+ on the page size of the system on which localedef is run. */
+ const size_t pagesz = 4096;
int small_mask;
head = ah->addr;
--
Joseph S. Myers
joseph@codesourcery.com