This will warn if NULL is passed to any nonnull-annotated parameter, and is also supported by sanitizers which can check for violations at runtime. Unfortunately, it is currently only supported by clang. GCC has a similar feature in the nonnull attribute, but this has a different syntax (it's a function attribute) and is more dangerous since it is used by the optimizer to assume a null pointer is undefined behavior. This one just warns and still allows code to handle the situation gracefully, which I think is more appropriate for a library API. Note that this optimization behavior is not some unlikely edge case: switching these attributes to the GCC one will break release builds.
|2 years ago|
|doc||2 years ago|
|include||2 years ago|
|src||2 years ago|
|test||2 years ago|
|waflib@4b03300471||2 years ago|
|.gitattributes||2 years ago|
|.gitignore||3 years ago|
|.gitlab-ci.yml||2 years ago|
|.gitmodules||3 years ago|
|.travis.yml||5 years ago|
|AUTHORS||12 years ago|
|COPYING||2 years ago|
|INSTALL||7 years ago|
|NEWS||2 years ago|
|README.md||3 years ago|
|serd.pc.in||9 years ago|
|serd.ttl||3 years ago|
|serd_bench.py||4 years ago|
|waf||3 years ago|
|wscript||2 years ago|
Serd is a lightweight C library for RDF syntax which supports reading and writing Turtle, TriG, NTriples, and NQuads. Serd is suitable for performance-critical or resource-limited applications, such as serialising very large data sets or embedded systems.
Portable and Dependency-Free: Serd has no external dependencies other than the C standard library. It is known to compile with GCC, Clang, and MSVC (as C++), and is tested on GNU/Linux, MacOS, and Windows.
Small: Serd is implemented in a few thousand lines of C. It typically compiles to about 100 KiB, or about 50 KiB stripped with size optimizations.
Fast and Lightweight: Serd can stream abbreviated Turtle, unlike many tools which must first build an internal model. This makes it particularly useful for writing very large data sets, since it can do so using only a small amount of memory. Serd is, to the author's knowledge, the fastest Turtle reader/writer by a wide margin (see Performance below).
Conformant and Well-Tested: Serd passes all tests in the Turtle and TriG test suites, correctly handles all "normal" examples in the URI specification, and includes many additional tests which were written manually or discovered with fuzz testing. The test suite is run continuously on many platforms, has 100% code coverage by line, and runs with zero memory errors or leaks.
The benchmarks below compare
serdi, rapper, and riot re-serialising
Turtle data generated by sp2b on an i7-4980HQ running Debian 9. Of the
serdi is the fastest by a wide margin, and the only one that uses a
constant amount of memory (a single page) for all input sizes.
-- David Robillard firstname.lastname@example.org