This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
memset & 'VirtualQuery'
- From: "Christophe Jaillet" <christophe dot jaillet at wanadoo dot fr>
- To: "Cygwin patches" <cygwin-patches at cygwin dot com>
- Date: Wed, 1 Jun 2005 23:27:30 +0200
- Subject: memset & 'VirtualQuery'
Hi,
when looking thrue cygwin code looking for function 'VirtualQuery', we can
see that it is passed a structure (MEMORY_BASIC_INFORMATION).
In some cases, this structure is memset'ed to 0 before the call, sometimes,
not.
My very own opinion about it, is that there is no need to reset the content
of the structure before the call and in some places a call to memset can be
avoided.
Here is a list of the call to 'VirtualQuery' which uses memset and could be
optimised :
- cygthread.cc (terminate_thread)
- fork.cc (stack_base)
- exceptions.cc (interruptible)
All the other calls to 'VirtualQuery' don't use memset.
If you think it is useful, I can provide a patch for this in the next few
days.
CJ