Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 3 Jun 2005 16:19:30 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: memset & 'VirtualQuery' Message-ID: <20050603201930.GD32209@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <001701c56873$6a20f640$96cefea9 AT none> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001701c56873$6a20f640$96cefea9@none> User-Agent: Mutt/1.5.8i On Fri, Jun 03, 2005 at 09:35:35PM +0200, Christophe Jaillet wrote: >[sorry for the wrong post in cygwin-patches...] > >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. All of the calls to VirtualQuery which first clear the MEMORY_BASIC_INFORMATION structure do so for a reason -- it simplifies subsequent inspection of that structure if you are assured that it is all zero. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/