You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by hathach <ha...@live.com> on 2016/07/25 07:58:29 UTC
cbmem_init() potential bug
Hi,
In the cbmem_init() the mutex lock is initialized then the whole struct is
cleared
https://github.com/apache/incubator-mynewt-core/blob/master/libs/util/src/cb
mem.c#L29
It is not a big deal for now since os_mutex_init() seems to only clear the
os_mutex object. However for the sake of safety, should we memset the struct
first then initializing its member including the c_lock just in case you
guys decide to change the os_mutex_init() implementation later.
Best regards,
Ha Thach