Consider using attribute counted_by
Aperta
- Lingua principale
- C
- Stelle
- 5.6k
- Fork
- 510
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
IDK if it's applicable here, but recent versions of clang and gcc have added support for having the compiler insert runtime checks when you have a flexible array member and a distinct member for a count, that upon access to the flexible array member, the compiler will insert checks against the count member (which may be optimized out as being redundant if there are explicit length checks).
https://people.kernel.org/gustavoars/how-to-use-the-new-counted_by-attribute-in-c-and-linux
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.