antirez / antirez/sds

Consider using attribute counted_by

Open
#155 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
5.6k
Forks
510
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.