Re: [PATCH v2 1/1] Make __sdidinit unused
Corinna Vinschen <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
Hi Seb, On Feb 18 17:21, Sebastian Huber wrote: > Hello Corinna, > > On 18/02/2022 13:41, Corinna Vinschen wrote: > > Hi Matt, > > > > On Feb 18 10:45, Matthew Joyce wrote: > > > Remove dependency on __sdidinit member of struct _reent to check > > > object initialization. Like __sdidinit, the __cleanup member of > > > struct _reent is initialized in the __sinit() function. Checking > > > initialization against __cleanup serves the same purpose and will > > > reduce overhead in the __sfp() function in a follow up patch. > > > > The patch looks right now. But. > > > > What exactly are you going to do in __sfp? The reason I'm asking is > > that it's absolutely not clear yet which purpose this change serves. > > Looking at this patch, I only see that, rather than using an available > > flag, a pointer is now set to an invalid value -1, which looks more > > dangerous than what we did before. > > > > Care to explain or, even better, send the patch you have in mind? > > this is related to our attempt to use individual thread-local storage > objects instead of the monolithic struct _reent: > > https://sourceware.org/pipermail/newlib/2022/018855.html > > It turned out that this is not possible while _GLOBAL_REENT exists. Getting > rid of struct _reent members with similar functionality helps to refactor > the code. > > Instead of using -1 as a magic value a safer option would be to assign a > dummy function which does nothing: > [...] I like the idea. This looks good in the code. A comment in _cygtls::init_thread might be helpful in future, but it's not required for this patch submission. Matt, can you pleae resubmit with this change? Thanks, Corinna