Skip to content

Commit

Permalink
Remove debug flag from build. Updated README and all code comments/do…
Browse files Browse the repository at this point in the history
…cumentation
  • Loading branch information
rrozansk committed Apr 26, 2017
1 parent 91c9619 commit 01fa073
Show file tree
Hide file tree
Showing 9 changed files with 395 additions and 156 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# compiler to use
CC = gcc
# flags to compiler
CFLAGS = -Wall -g -O3
# flags to compiler -g (debug flag)
CFLAGS = -Wall -O3
# include
INCLUDES = -I/include/ -Iinclude/
# lib
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Cheney-GC

[![LICENSE](https://img.shields.io/badge/LICENSE-MIT-green.svg)](https://github.com/rrozansk/Cheney-GC/blob/master/LICENSE.txt)

An implementation of Cheney style garbage collection for cons cells.
Also includes a tree generator and printer, both capable of handling cycles.
A Makefile is included to generate an executable in which to help drive and visualize the garbage collection process.
[![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)]()

An implementation of Cheney style garbage collection for use with cons cells.

The repository includes three libraries:
* bits - capable of bit manipulations on pointers
* trees - binary tree generator/printer capable of handling cycles
* cheney - garabge collector and cons cell implementations

A Makefile is also included along with test.c which generates an executable to drive and visualize the garbage collection process.

## Prerequisites
- gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 or equivalent
Expand All @@ -15,4 +20,5 @@ A Makefile is included to generate an executable in which to help drive and visu
$ git clone https://github.com/rrozansk/Cheney-GC.git
$ cd Cheney-GC
$ make
$ ./cheney
```
90 changes: 76 additions & 14 deletions include/bits.h
Original file line number Diff line number Diff line change
@@ -1,26 +1,88 @@
/**********************************************************************
F I L E I N F O R M A T I O N
***********************************************************************/
/*
Author: Ryan Rozanski
Created: 1/21/17
Edited: 1/21/17
*/
/******************************************************************************
* FILE: bits.h *
* AUTHOR: Ryan Rozanski *
* CREATED: 1/21/17 *
* EDITED: 4/25/17 *
* INFO: A library for bit diddling with pointers. *
* *
******************************************************************************/

#ifndef BIT_DIDDLING_DEFS
#define BIT_DIDDLING_DEFS

/**********************************************************************
/******************************************************************************
* *
* F U N C T I O N P R O T O T Y P E S *
* *
******************************************************************************/

F U N C T I O N P R O T O T Y P E S
***********************************************************************/
/******************************************************************************
* *
* PURPOSE: To set a specific bit in an arbitrary pointer. *
* *
* ARGUMENT DESCRIPTION *
* -------- ----------- *
* ptr the pointer to modify *
* bit the specific bit to set *
* *
* RETURNS: N/A *
* *
******************************************************************************/
void setBit(void **ptr, int bit);

/******************************************************************************
* *
* PURPOSE: To clear a specific bit in an arbitrary pointer. *
* *
* ARGUMENT DESCRIPTION *
* -------- ----------- *
* ptr the pointer to modify *
* bit the specific bit to clear *
* *
* RETURNS: N/A *
* *
******************************************************************************/
void clrBit(void **ptr, int bit);

/******************************************************************************
* *
* PURPOSE: To flip a specific bit in an arbitrary pointer. *
* *
* ARGUMENT DESCRIPTION *
* -------- ----------- *
* ptr the pointer to modify *
* bit the specific bit to flip *
* *
* RETURNS: N/A *
* *
******************************************************************************/
void flpBit(void **ptr, int bit);

/******************************************************************************
* *
* PURPOSE: To determine if a specific bit is set in an arbitrary pointer. *
* *
* ARGUMENT DESCRIPTION *
* -------- ----------- *
* ptr the pointer to modify *
* bit the specific bit in question *
* *
* RETURNS: 1 if the specified bit is set, 0 otherwise. *
* *
******************************************************************************/
int getBit(void **ptr, int bit);

/******************************************************************************
* *
* PURPOSE: To display an integer in its binary representation. *
* *
* ARGUMENT DESCRIPTION *
* -------- ----------- *
* n the integer to display in binary *
* *
* RETURNS: N/A *
* *
******************************************************************************/
void printBin(unsigned int n);

#endif
Loading

0 comments on commit 01fa073

Please sign in to comment.