-----Original Message-----
From: Brooks Davis <[email protected]>
Date: 2018-06-07, Thursday at 09:27
To: Ravi Pokala <[email protected]>
Cc: "Jonathan T. Looney" <[email protected]>, Mateusz Guzik <[email protected]>, 
Mateusz Guzik <[email protected]>, src-committers <[email protected]>, 
<[email protected]>, <[email protected]>
Subject: Re: svn commit: r334702 - head/sys/sys

> 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 analysis of the 
>> larger context, and potentially skipping zeroing parts that are set 
>> immediately after the call.
> 
> Clang does this.  It does make for some quite interesting object code,
> but the result is that zeroing with __builtin_memset() is basically free
> for mostly-initialized structures.
> 
> -- Brooks

Yeah, it's a subtle but obvious optimization in hindsight. Thanks for the info.

-Ravi (rpokala@)


_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to