<p><a href="https://gerrit.osmocom.org/c/libosmocore/+/15026">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/15026/4/include/osmocom/codec/ecu.h">File include/osmocom/codec/ecu.h:</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/15026/4/include/osmocom/codec/ecu.h@45">Patch Set #4, Line 45:</a> <code style="font-family:monospace,monospace">uint8_t data[0];</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Not sure if it's a good idea to use a flexible array member here. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">it's a very typcial pattern in linux kernel development, hence that's what I'm using here, too.  In general, the "data" part is allocated always at the same time as the osmo_ecu_state.  Allocating them both at the same time avoids malloc pressure, can help avoid memory fragmentation, allows the use of "offsetof" to get from inner to outer struct (rather than having to use an explicit back-pointer) and avoids the risk of ever only freeing one of the two.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/15026">change 15026</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/c/libosmocore/+/15026"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I4d33c9c7c2d4c7462ff38a49c178b65accae1915 </div>
<div style="display:none"> Gerrit-Change-Number: 15026 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 02 Aug 2019 07:19:47 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>