Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Ben
On 18-01-2021 15:49, Corinna Vinschen via Cygwin-patches wrote: > > Care to send the resulting patch? > Will send with next patch-set. Ben...

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 14:51, Ben wrote: > On 18-01-2021 14:04, Corinna Vinschen via Cygwin-patches wrote: > > What about this instead? It should be better optimizable: > > > Hmmm: > * _remove_r should still set reent->_errno This is redundant: errno == (*__errno ()) == _REENT->_errno == __getreent

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Ben
On 18-01-2021 14:04, Corinna Vinschen via Cygwin-patches wrote: > What about this instead? It should be better optimizable: > Hmmm: * _remove_r should still set reent->_errno * _GLOBAL_REENT isn't threadlocal, what about __getreent() So maybe: diff --git a/winsup/cygwin/syscalls.cc

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 13:40, Ben wrote: > On 18-01-2021 11:56, Corinna Vinschen via Cygwin-patches wrote: > > Hmm, you're adding another function call to the call stack. Doesn't > > that slow down _remove_r rather than speeding it up? Ok, this function > > is called from _tmpfile_r/_tmpfile64_r only, so

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Ben
On 18-01-2021 11:56, Corinna Vinschen via Cygwin-patches wrote: > Hmm, you're adding another function call to the call stack. Doesn't > that slow down _remove_r rather than speeding it up? Ok, this function > is called from _tmpfile_r/_tmpfile64_r only, so dedup may trump speed > here... > >

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > The _remove_r code is already in the remove function. > Therefore, just call the remove function and make > sure errno is set correctly in the reent struct. > --- > winsup/cygwin/syscalls.cc | 15 ++- > 1 file changed, 6 insertions(+), 9