Re: localtime on native Windows

2024-02-18 Thread Paul Eggert
On 2024-02-18 06:38, Bruno Haible wrote: - How can the caller do the caching for something internal to the callee? The caller calls tzalloc, gets a timezone object, and calls tzfree when it no longer needs that timezone object. - The NetBSD code [1][2] does locking in the top-level fun

Re: localtime on native Windows

2024-02-18 Thread Bruno Haible
Paul Eggert wrote: > > Note also: The above approach will need locking, in order to protect caches > > (in 1) the data for a single time zone, in 3) the contents of tzdata.zi). > > The idea I had was to go more in the NetBSD / TZDB direction. These > implementations don't need either locks or loc

Re: localtime on native Windows

2024-02-17 Thread Brian . Inglis
On 2024-02-17 19:14, Bruno Haible wrote: Brian Inglis wrote: I was looking around ... that required data can be shrunk to ~300KB using Brotli!? Whereas the entire tzdata.zi (without comments, and with abbreviations) is only around 100 KB. I'll definitely prefer the latter. Other options wou

Re: localtime on native Windows

2024-02-17 Thread Paul Eggert
On 2024-02-17 18:38, Bruno Haible wrote: Note also: The above approach will need locking, in order to protect caches (in 1) the data for a single time zone, in 3) the contents of tzdata.zi). The idea I had was to go more in the NetBSD / TZDB direction. These implementations don't need either l

Re: localtime on native Windows

2024-02-17 Thread Bruno Haible
Paul Eggert wrote: > > The first question is how to include tzdata in gnulib. > >- AFAICS, the main data file (without comments) is tzdata.zi and is about > > 100 KB large. It can be upgraded simply by copying the newest tzdata.zi > > from a newer tzdata distribution. Including such a

Re: localtime on native Windows

2024-02-17 Thread Bruno Haible
Brian Inglis wrote: > I was looking around ... that required data can be shrunk to ~300KB using > Brotli!? Whereas the entire tzdata.zi (without comments, and with abbreviations) is only around 100 KB. I'll definitely prefer the latter. > Other options would be for some selection of generated da

Re: localtime on native Windows

2024-02-13 Thread Brian Inglis
On Sun, 11 Feb 2024 13:46:50 +0100, Bruno Haible wrote on bug-gnulib: I wrote: For these modules, the next function to provide in an MT-safe way is localtime_r. Our gmtime_r and localtime_r are MT-safe on native Windows. I ran the test-gmtime_r-mt and test-localtime_r-mt tests for 2000 seconds

Re: localtime on native Windows

2024-02-12 Thread Paul Eggert
On 2024-02-11 04:46, Bruno Haible wrote: The first question is how to include tzdata in gnulib. - AFAICS, the main data file (without comments) is tzdata.zi and is about 100 KB large. It can be upgraded simply by copying the newest tzdata.zi from a newer tzdata distribution. Includin

localtime on native Windows

2024-02-11 Thread Bruno Haible
I wrote: > For these modules, the next function to provide in an MT-safe way is > localtime_r. Our gmtime_r and localtime_r are MT-safe on native Windows. I ran the test-gmtime_r-mt and test-localtime_r-mt tests for 2000 seconds each, and they did not crash. But the problem is that localtime() an