Skip to content

Commit 01fa073

Browse files
committed
Remove debug flag from build. Updated README and all code comments/documentation
1 parent 91c9619 commit 01fa073

File tree

9 files changed

+395
-156
lines changed

9 files changed

+395
-156
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# compiler to use
22
CC = gcc
3-
# flags to compiler
4-
CFLAGS = -Wall -g -O3
3+
# flags to compiler -g (debug flag)
4+
CFLAGS = -Wall -O3
55
# include
66
INCLUDES = -I/include/ -Iinclude/
77
# lib

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Cheney-GC
22

3-
[![LICENSE](https://img.shields.io/badge/LICENSE-MIT-green.svg)](https://github.com/rrozansk/Cheney-GC/blob/master/LICENSE.txt)
4-
5-
An implementation of Cheney style garbage collection for cons cells.
6-
Also includes a tree generator and printer, both capable of handling cycles.
7-
A Makefile is included to generate an executable in which to help drive and visualize the garbage collection process.
3+
[![LICENSE](https://img.shields.io/badge/LICENSE-MIT-green.svg)](https://github.com/rrozansk/Cheney-GC/blob/master/LICENSE.txt) [![RELEASE](https://img.shields.io/badge/release-stable-green.svg)]()
4+
5+
An implementation of Cheney style garbage collection for use with cons cells.
6+
7+
The repository includes three libraries:
8+
* bits - capable of bit manipulations on pointers
9+
* trees - binary tree generator/printer capable of handling cycles
10+
* cheney - garabge collector and cons cell implementations
11+
12+
A Makefile is also included along with test.c which generates an executable to drive and visualize the garbage collection process.
813

914
## Prerequisites
1015
- gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 or equivalent
@@ -15,4 +20,5 @@ A Makefile is included to generate an executable in which to help drive and visu
1520
$ git clone https://github.com/rrozansk/Cheney-GC.git
1621
$ cd Cheney-GC
1722
$ make
23+
$ ./cheney
1824
```

include/bits.h

+76-14
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,88 @@
1-
/**********************************************************************
2-
3-
F I L E I N F O R M A T I O N
4-
5-
***********************************************************************/
6-
/*
7-
Author: Ryan Rozanski
8-
Created: 1/21/17
9-
Edited: 1/21/17
10-
*/
1+
/******************************************************************************
2+
* FILE: bits.h *
3+
* AUTHOR: Ryan Rozanski *
4+
* CREATED: 1/21/17 *
5+
* EDITED: 4/25/17 *
6+
* INFO: A library for bit diddling with pointers. *
7+
* *
8+
******************************************************************************/
119

1210
#ifndef BIT_DIDDLING_DEFS
1311
#define BIT_DIDDLING_DEFS
1412

15-
/**********************************************************************
13+
/******************************************************************************
14+
* *
15+
* F U N C T I O N P R O T O T Y P E S *
16+
* *
17+
******************************************************************************/
1618

17-
F U N C T I O N P R O T O T Y P E S
18-
19-
***********************************************************************/
19+
/******************************************************************************
20+
* *
21+
* PURPOSE: To set a specific bit in an arbitrary pointer. *
22+
* *
23+
* ARGUMENT DESCRIPTION *
24+
* -------- ----------- *
25+
* ptr the pointer to modify *
26+
* bit the specific bit to set *
27+
* *
28+
* RETURNS: N/A *
29+
* *
30+
******************************************************************************/
2031
void setBit(void **ptr, int bit);
32+
33+
/******************************************************************************
34+
* *
35+
* PURPOSE: To clear a specific bit in an arbitrary pointer. *
36+
* *
37+
* ARGUMENT DESCRIPTION *
38+
* -------- ----------- *
39+
* ptr the pointer to modify *
40+
* bit the specific bit to clear *
41+
* *
42+
* RETURNS: N/A *
43+
* *
44+
******************************************************************************/
2145
void clrBit(void **ptr, int bit);
46+
47+
/******************************************************************************
48+
* *
49+
* PURPOSE: To flip a specific bit in an arbitrary pointer. *
50+
* *
51+
* ARGUMENT DESCRIPTION *
52+
* -------- ----------- *
53+
* ptr the pointer to modify *
54+
* bit the specific bit to flip *
55+
* *
56+
* RETURNS: N/A *
57+
* *
58+
******************************************************************************/
2259
void flpBit(void **ptr, int bit);
60+
61+
/******************************************************************************
62+
* *
63+
* PURPOSE: To determine if a specific bit is set in an arbitrary pointer. *
64+
* *
65+
* ARGUMENT DESCRIPTION *
66+
* -------- ----------- *
67+
* ptr the pointer to modify *
68+
* bit the specific bit in question *
69+
* *
70+
* RETURNS: 1 if the specified bit is set, 0 otherwise. *
71+
* *
72+
******************************************************************************/
2373
int getBit(void **ptr, int bit);
74+
75+
/******************************************************************************
76+
* *
77+
* PURPOSE: To display an integer in its binary representation. *
78+
* *
79+
* ARGUMENT DESCRIPTION *
80+
* -------- ----------- *
81+
* n the integer to display in binary *
82+
* *
83+
* RETURNS: N/A *
84+
* *
85+
******************************************************************************/
2486
void printBin(unsigned int n);
2587

2688
#endif

0 commit comments

Comments
 (0)