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
-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
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
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
, , <
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
-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
-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
-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:
>>
>
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
> >
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
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/
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
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
13 matches
Mail list logo