mirror of
https://codeberg.org/andyscott/marCsweep.git
synced 2025-01-02 23:05:55 -05:00
README: updated for new malloc and directory structure
This commit is contained in:
parent
73e2716100
commit
c73dfc2c00
1 changed files with 20 additions and 10 deletions
30
README.md
30
README.md
|
@ -1,38 +1,44 @@
|
||||||
# marCsweep
|
# marCsweep
|
||||||
|
|
||||||
A mark-and-sweep garbage collector with a simple virtual machine to perform
|
A mark-and-sweep garbage collector written in C.
|
||||||
allocations.
|
|
||||||
|
Includes a simple virtual machine and a custom `malloc` implementation
|
||||||
|
for creating, tracing, and freeing garbage.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Compiling the project should be relatively easy, even if you aren't familiar
|
Compiling the project should be relatively easy, even if you aren't familiar
|
||||||
with `make`.
|
with `make`.
|
||||||
|
|
||||||
Dependencies: `git`, `make`, and `gcc`. Compiling with `clang` is also possible,
|
Dependencies: `git`, `make`, and `gcc`.
|
||||||
simply replace "gcc" with "clang" in the first line of the Makefile.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://codeberg.org/andyscott/marCsweep.git
|
git clone https://codeberg.org/andyscott/marCsweep.git
|
||||||
|
|
||||||
cd marCsweep
|
cd marCsweep
|
||||||
|
|
||||||
make release
|
make release # or debug
|
||||||
```
|
```
|
||||||
|
|
||||||
That's it! The Makefile will automatically create the build directory and place
|
That's it! Make will create the `bin` directory and place the finished
|
||||||
the compiled executable there.
|
executable there.
|
||||||
|
|
||||||
|
Compiling with `clang` is also supported, just replace "gcc" with "clang" in the
|
||||||
|
first line of the `Makefile`. Also note that if you don't specify a target for
|
||||||
|
make (i.e. "release" or "debug") both will be built. Debug builds are placed in
|
||||||
|
the `debug` directory.
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
Once compiled, the program can be run with the following:
|
Once compiled, the program can be run with the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
cd build # or debug
|
cd bin # or debug
|
||||||
|
|
||||||
./gc
|
./gc
|
||||||
```
|
```
|
||||||
|
|
||||||
By default the program will output the results of the test cases:
|
The results of the test cases will be output to your terminal:
|
||||||
|
|
||||||
> test_int_alloc: PASS
|
> test_int_alloc: PASS
|
||||||
test_pair_alloc: PASS
|
test_pair_alloc: PASS
|
||||||
|
@ -49,4 +55,8 @@ should be ready for experimentation!
|
||||||
This is a personal project that I am writing in my free time to learn more about
|
This is a personal project that I am writing in my free time to learn more about
|
||||||
garbage collection. Thank you to [Robert
|
garbage collection. Thank you to [Robert
|
||||||
Nystrom](https://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)
|
Nystrom](https://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)
|
||||||
for the idea.
|
for the idea.
|
||||||
|
|
||||||
|
Sadly, it was this author's idea to extend the project by writing a custom
|
||||||
|
`malloc`. Perhaps I should have been lazy and used the preexisting definitions,
|
||||||
|
but where's the fun in that?
|
||||||
|
|
Loading…
Reference in a new issue