Files
refcount/README.md
T

46 lines
1.2 KiB
Markdown
Raw Normal View History

2025-08-28 05:03:58 -07:00
# RefCount
RefCount is a reference counting (thus the name) and garbage collection library
2025-09-06 04:29:50 -07:00
written in C.
RefCount has support for
2025-09-07 16:55:20 -07:00
- Breaking dependency chains via garbage collection
2025-09-06 04:29:50 -07:00
- Multiple distinct contexts allowing the tracking of many types of objects,
each with a possibly different memory allocation implementation
- Safely running in multi-threaded environments
2025-09-07 16:55:20 -07:00
- Destructors that can possibly re-reference an object to save it
2025-08-28 05:03:58 -07:00
### Building
2025-09-06 04:29:50 -07:00
The only external requirement is [ht](https://git.zander.im/Zander671/ht). If
you build using the instructions below, CMake will automatically download and
build the dependency for you.
For multi threading support, you need a C11 compiler that supports atomic types
and has the `<threads.h>` header. Without threading support, you only need a C99
compiler.
2025-08-28 05:03:58 -07:00
You can build using:
```sh
2025-09-06 04:29:50 -07:00
cmake -B build .
# replace with above with
# cmake -B build -DREFCOUNT_USE_THREADS=OFF
# to build without threads (change the "OFF" to "ON" to re-enable threads)
2025-08-28 05:03:58 -07:00
make -C build
```
You can then run tests using:
```sh
make -C build test
```
### Documentation
You can generate documentation with:
```
doxygen
```
2025-09-05 20:01:36 -07:00
You can look in the `test/` directory for some examples of the various features
of RefCount in use.