Re: svn commit: r334702 - head/sys/sys

2018-06-07 Thread Mark Millard via svn-src-head
Jonathan T. Looney jtl at freebsd.org wrote on Thu Jun 7 03:00:00 UTC 2018 : > I believe the theory is that the compiler (remember, this is > __builtin_memset) can optimize away portions of the zeroing, or can > optimize zeroing for small sizes. > > For example, imagine you do this: > > stru

Re: svn commit: r334702 - head/sys/sys

2018-06-07 Thread Ravi Pokala
-Original Message- From: Brooks Davis Date: 2018-06-07, Thursday at 09:27 To: Ravi Pokala Cc: "Jonathan T. Looney" , Mateusz Guzik , Mateusz Guzik , src-committers , , Subject: Re: svn commit: r334702 - head/sys/sys > On Thu, Jun 07, 2018 at 12:01:00AM -0400, Ravi Pokala

Re: svn commit: r334702 - head/sys/sys

2018-06-07 Thread Brooks Davis
On Thu, Jun 07, 2018 at 12:01:00AM -0400, Ravi Pokala wrote: > > I believe the theory is that the compiler (remember, this is > > __builtin_memset) can optimize away portions of the zeroing, or can > > optimize zeroing for small sizes. > > Ahhh! I didn't consider that the compiler would be doing

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Ravi Pokala
ipping zeroing parts that are set immediately after the call. Thanks! -Ravi (rpokala@) -Original Message- From: "Jonathan T. Looney" Date: 2018-06-06, Wednesday at 22:58 To: Ravi Pokala Cc: Mateusz Guzik , Mateusz Guzik , src-committers , , Subject: Re: svn commit: r334702

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Jonathan T. Looney
, , < svn-src-head@freebsd.org> > Subject: Re: svn commit: r334702 - head/sys/sys > > > On Wed, Jun 6, 2018 at 1:35 PM, Ravi Pokala wrote: > > > >>> + * Passing the flag down requires malloc to blindly zero the entire object. > >>> + * In practice a lot

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Ravi Pokala
-Original Message- From: on behalf of Mateusz Guzik Date: 2018-06-06, Wednesday at 09:01 To: Ravi Pokala Cc: Mateusz Guzik , src-committers , , Subject: Re: svn commit: r334702 - head/sys/sys > On Wed, Jun 6, 2018 at 1:35 PM, Ravi Pokala wrote: > >>> + * Passin

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Conrad Meyer
-Original Message- >> From: on behalf of Mateusz Guzik >> >> Date: 2018-06-06, Wednesday at 01:08 >> To: , , >> >> Subject: svn commit: r334702 - head/sys/sys >> >> > ... >> > #ifdef _KERNEL >> > #define malloc(si

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Ravi Pokala
-Original Message- From: on behalf of Benjamin Kaduk Date: 2018-06-06, Wednesday at 07:40 To: Ravi Pokala Cc: Mateusz Guzik , src-committers , , Subject: Re: svn commit: r334702 - head/sys/sys > On Wed, Jun 6, 2018 at 6:35 AM, Ravi Pokala wrote: >> >

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Mateusz Guzik
On Wed, Jun 6, 2018 at 1:35 PM, Ravi Pokala wrote: > > + * Passing the flag down requires malloc to blindly zero the entire > object. > > + * In practice a lot of the zeroing can be avoided if most of the object > > + * gets explicitly initialized after the allocation. Letting the > compiler > >

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Bruce Evans
On Wed, 6 Jun 2018, Benjamin Kaduk wrote: On Wed, Jun 6, 2018 at 6:35 AM, Ravi Pokala wrote: Hi Mateusz, ... ... #ifdef _KERNEL #define malloc(size, type, flags) ({ \ Now that I'm taking another look at this, I'm confused as to why the entire macro expansion is inside parenthe

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Benjamin Kaduk
On Wed, Jun 6, 2018 at 6:35 AM, Ravi Pokala wrote: > Hi Mateusz, > > -Original Message- > From: on behalf of Mateusz Guzik > > Date: 2018-06-06, Wednesday at 01:08 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r334702 - head/sys/

Re: svn commit: r334702 - head/sys/sys

2018-06-06 Thread Ravi Pokala
Hi Mateusz, -Original Message- From: on behalf of Mateusz Guzik Date: 2018-06-06, Wednesday at 01:08 To: , , Subject: svn commit: r334702 - head/sys/sys > Author: mjg > Date: Wed Jun 6 05:08:05 2018 > New Revision: 334702 > URL: https://svnweb.freebsd.org/changeset

svn commit: r334702 - head/sys/sys

2018-06-05 Thread Mateusz Guzik
Author: mjg Date: Wed Jun 6 05:08:05 2018 New Revision: 334702 URL: https://svnweb.freebsd.org/changeset/base/334702 Log: malloc: elaborate on r334545 due to frequent questions While here annotate the NULL check as probably true. Modified: head/sys/sys/malloc.h Modified: head/sys/sys/m