<p style="white-space: pre-wrap; word-wrap: break-word;">You don't have to change the double-intialization right now before the merge, but I would ask you to create a ticket about it and look into replacing any such instances at some point in the future.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Same goes for Vadim's other comments [as far as they are valid].  Let's make sure you put something in place (ticket or whatever else) to not forget about those, thanks.</p><p>Patch set 18:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #d4ffd4;">Code-Review +2</span></p><p><a href="https://gerrit.osmocom.org/13137">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/e_link.c">File src/libmsc/e_link.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/e_link.c@77">Patch Set #9, Line 77:</a> <code style="font-family:monospace,monospace">*e = (struct e_link) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I prefer this to clearly indicate that the struct is initialized from scratch. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">the point is that the compiler is unable to optimize away initializing the same bit of memory *twice*, as talloc hapepns inside a library (and thus is outside of the scope of allocation).</p><p style="white-space: pre-wrap; word-wrap: break-word;">I'm flexible to tolerate different preferences in syntax or code style to some extent, but when it comes with a runtime overhead, then I'm quite certain the variant causing the overhead is inferior to the veriant that doesn't.</p><p style="white-space: pre-wrap; word-wrap: break-word;">So please kindly adjust your "common pattern" in a way that doesn't incur runtime overhead.  Either you don't use talloc_zero() but regular talloc(), or (very much preferred) don't initialize the entire struct all over again.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Sure, we have many other areas left for optimization, but there is absolutely zero advantage to initializing the memory twice to (mostly) zero.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/13137">change 13137</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/13137"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd </div>
<div style="display:none"> Gerrit-Change-Number: 13137 </div>
<div style="display:none"> Gerrit-PatchSet: 18 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-CC: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 08 May 2019 06:41:52 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>