Sc

Common libraries and data structures for C.
Alternatives To Sc
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Coding Interview University268,245
14 hours ago56cc-by-sa-4.0
A complete computer science study plan to become a software engineer.
Javascript Algorithms175,41748 days ago4June 02, 2018340mitJavaScript
📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
Fucking Algorithm119,578
10 days ago360Markdown
刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.
Interviews60,220
2 months ago113mitJava
Everything you need to know to get the job.
Java53,751
2 hours ago22mitJava
All Algorithms implemented in Java
Leetcode52,422
13 days ago7otherJavaScript
LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)
Algorithm Visualizer42,745
5 months ago58mitJavaScript
:fireworks:Interactive Online Platform that Visualizes Algorithms from Code
Hello Algo35,467
3 hours ago17otherJava
《Hello 算法》:动画图解、一键运行的数据结构与算法教程,支持 Java, C++, Python, Go, JS, TS, C#, Swift, Rust, Dart, Zig 等语言。
Interview29,284
3 months ago15otherC++
📚 C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内推等信息。This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.
Swift Algorithm Club28,059
2 months ago61mitSwift
Algorithms and data structures in Swift, with explanations!
Alternatives To Sc
Select To Compare


Alternative Project Comparisons
Readme

Overview

License: BSD codecov

Portable, stand-alone C libraries and data structures. (C99)

Each folder is stand-alone with a single header/source pair in it. There is no
build for libraries, just copy files you want.

e.g., If you want the logger, copy sc_log.h and sc_log.c to your project.

Features

  • High performance & minimal memory usage
  • Portability between many operating systems and architectures
  • Tests with 100% branch coverage and multiple sanitizers
  • Drag & drop source code distribution

Test

There is 100% branch-coverage on Linux and CI runs on

OS         : Linux, MacOS, FreeBSD and Windows  
Compilers  : GCC, Clang, MSVC  
Arch       : x64, aarch64, armv6(32 bit), armv7(32 bit), ppc64le, s390x(big endian), riscv64  
Sanitizers : valgrind and clang/gcc sanitizers(address, undefined, thread)

List

Library Description
array Generic array/vector
buffer Buffer for encoding/decoding variables, best fit for protocol/serialization implementations
condition Condition wrapper for Posix and Windows
crc32 Crc32c, uses crc32c CPU instruction if available
heap Min heap which can be used as max heap/priority queue as well
ini Ini parser
linked list Intrusive linked list
logger Logger
map A high performance open addressing hashmap
memory map Mmap wrapper for Posix and Windows
mutex Mutex wrapper for Posix and Windows
option Cmdline argument parser. Very basic one
perf Benchmark utility to get performance counters info via perf_event_open()
queue Generic queue which can be used as dequeue/stack/list as well
sc Utility functions
signal Signal safe snprintf & Signal handler (handling CTRL+C, printing backtrace on crash etc)
socket Pipe / tcp sockets(also unix domain sockets) /Epoll/Kqueue/WSAPoll for Posix and Windows
string Length prefixed, null terminated C strings.
thread Thread wrapper for Posix and Windows.
time Time and sleep functions for Posix and Windows
timer Hashed timing wheel implementation with fast poll / cancel ops
uri A basic uri parser

Q&A


  • Is it any better than library X ?
    I often use these libraries for high performance server-side applications. Also,
    I care about readable and easy to debug code. In summary, these libraries show
    my taste(trade-offs) about performance/api-design/readability. You may or may
    not like it.

  • Why don't you change API here at X, so it will be easier to use?
    Send a pull request please but be sure you don't introduce an undefined
    behavior. It's possible to provide better APIs, especially to generic libraries,
    if you don't care about undefined behaviors. I try to avoid it.

  • What is the most efficient way to use these libraries?
    Just like any other code. Add to your project as source files and ideally use
    -O3 -flto + PGO. It may not make any difference for your use case though.

  • Is library X being used in any product?
    Some libraries are used in the production but please always test yourself.

  • Is there any release?
    Please use the master branch. It's considered stable.

  • Will you keep API stable?
    Please don't expect a stable API. These libraries are quite
    small (most of them are less than a few hundreds lines of code) and ideally you
    are supposed to read the code and understand what it does and adapt it to your
    needs. So, you should not update libraries blindly. I expect you to handle
    any possible API differences easily. That being said, I'll do my best to keep
    API stable.

Popular Data Structure Projects
Popular Algorithms Projects
Popular Computer Science Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
C
Algorithms
Logger
Stack
Thread
Data Structures
Socket
Vector
Heap
Hashmap
Linked List
Priority Queue