Skip to content

fxdmhtt/stack-cstr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stack_cstr

stack_cstr is a high-performance Rust library for creating C-style strings (CStr/CString) efficiently.
It tries to write the formatted string into a stack buffer first, and if the string is too long, it falls back to heap allocation.
The final result is a safe C string that can be passed to FFI functions.

Features

  • Stack buffer attempt with configurable sizes
  • Automatic heap fallback for long strings
  • Supports format_args! style formatting
  • Returns Box<dyn CStrLike> for easy FFI usage
  • Simple macro interface: cstr!()
  • Extensible stack sizes

About

High-performance stack-to-heap C string creation for Rust with FFI support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages