This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Should glibc provide a builtin C.UTF-8 locale?


On 02/12/2015 02:25 PM, keld@keldix.com wrote:
>> The difference with the uncompressed locale archive is that it's NOT
>> loaded into memory, it's mmapped, just like executables and shared
>> libraries are. This means that only the used parts are ever resident
>> in memory at all, they're discardable (subject to reloading later on
>> the next access) just like anything else in the filesystem cache, and
>> shared by all processes using glibc.
> 
> I see. Are message catalogues also mmapped?

Yes, directly from disk.

glibc/catgets/open_catalog.c:
216     (struct catalog_obj *) __mmap (NULL, st.st_size, PROT_READ,
217                                    MAP_FILE|MAP_COPY, fd, 0);

There is only ever one copy of a catalog in memory for the entire
system, and it is mapped into any process that needs it.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]