laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/15026 )
Change subject: codec/ecu: Introduce new generic Error Concealment Unit abstraction ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/15026/4/include/osmocom/codec/ecu.h File include/osmocom/codec/ecu.h: https://gerrit.osmocom.org/#/c/15026/4/include/osmocom/codec/ecu.h@45 PS4, Line 45: uint8_t data[0]; > Not sure if it's a good idea to use a flexible array member here. […] 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. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/15026 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I4d33c9c7c2d4c7462ff38a49c178b65accae1915 Gerrit-Change-Number: 15026 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pma...@sysmocom.de> Gerrit-Reviewer: fixeria <axilira...@gmail.com> Gerrit-Reviewer: laforge <lafo...@gnumonks.org> Gerrit-Comment-Date: Fri, 02 Aug 2019 07:19:47 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <axilira...@gmail.com> Gerrit-MessageType: comment