Skip to content

An experiment in implementing a stack structure in heap using linked lists

Notifications You must be signed in to change notification settings

terminalcommand/heapstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

heapstack

An experiment in implementing a stack structure in heap using linked lists

Motivation

This was entirely made for fun, the library is highly experimental. Due to automatic stack management in C, there may be some bugs. I intend to write a simple mark-and-sweep GC and move everything to the heap. But that's for a different project.

Requirements

Heapstack requires clinked, my modern linked list library for C.

What is this good for?

I was able to write a simple RPN calculator using this library. It supports basic push and pop operations. There is a variadic function to initialize new lists, which I think is cool :).

RPN calculator example is located under examples/simplerpn.c.

SimpleRPN.exe
Please enter the expression to be evaluated: 34 4 + 99999 /
The input was: 34 4 + 99999 /
Parsing the input string '34 4 + 99999 /'
The result of the operation is: 0.000380

About

An experiment in implementing a stack structure in heap using linked lists

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages