Skip to content
/ scl Public

smol c library - fast dynamic data structures and utilities

License

Notifications You must be signed in to change notification settings

damemay/scl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smol c library

goals

  • fast, efficient code
  • small, easy to use api
  • use C99 for compatibility
  • tested and sanitized with UBSan and ASan
  • implement basic things of interest for quick reusage in C projects
  • single header file
  • license for you to choose: public domain or MIT

contents

data structures

  • sarr - void* array
  • slist - void* dynamic list
  • shtable - void* dynamic hash table
    • simplified implementation of cuckoo hashing (no loop)
    • hashed with yoshimura and MurmurHash3
    • uses nul-terminated char* keys

all of the structures above can be generated for non-pointer values with SCL_STRUCTURE_DEFINE(type) and SCL_STRUCTURE_IMPLEMENT(type) macros. Refer to scl.h for guidance.

utility functions

  • sread and sreadlns - read text/binary file into char* (nul-terminated or not) or into char* array
  • smalloc, scalloc, sfree - allocation wrappers for debugging (wrap in macro to use)

About

smol c library - fast dynamic data structures and utilities

Resources

License

Stars

Watchers

Forks