Skip to content

Commit

Permalink
fix some minor issues in the cdylib readme
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Dec 3, 2024
1 parent 551528b commit 590db29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libz-rs-sys-cdylib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Build `zlib-rs` as a drop-in replacement for the zlib dynamic library
cargo build --release

# the extension of a cdylib varies per platform
cc zpipe.c target/release/libz_rs.so
cc -o zpipe zpipe.c target/release/libz_rs.so -I .

# verify the implementation can compress and decompress our Cargo.toml
./zpipe < Cargo.toml | ./zpipe -d
Expand Down Expand Up @@ -69,15 +69,15 @@ flag. When enabled, the value of the `LIBZ_RS_SYS_PREFIX` is used as a prefix fo
000000000001d700 g DF .text 0000000000000051 Base MY_CUSTOM_PREFIX_uncompress
```

### `![no_std]`
### `#![no_std]`

The dynamic library can be built without the rust `std` crate, e.g. for embedded devices that don't support it. Disabling
the standard library has the following limitations:

- CPU feature detection is currently disabled. This is true for both compile-time and run-time feature detection.
This means `zlib-rs` will not make use of SIMD or other custom instructions.
- The `rust-allocator` should not be used. It internally enables the standard library, causing issues. Using `c-allocator`
or not providing an allocator at build time is still supported.On embedded it is most common to provide a custom allocator
or not providing an allocator at build time is still supported. On embedded it is most common to provide a custom allocator
that "allocates" into a custom array.

## Build for Distribution
Expand Down

0 comments on commit 590db29

Please sign in to comment.