projects
/
fur
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allocate Fur stacks on the C heap
[fur]
/
templates
/
program.c
diff --git
a/templates/program.c
b/templates/program.c
index
f2fc244
..
b25f7dc
100644
(file)
--- a/
templates/program.c
+++ b/
templates/program.c
@@
-163,6
+163,18
@@
void Stack_initialize(Stack* self)
self->length = 0;
}
self->length = 0;
}
+Stack* Stack_construct()
+{
+ Stack* result = malloc(sizeof(Stack));
+ Stack_initialize(result);
+ return result;
+}
+
+void Stack_destruct(Stack* self)
+{
+ free(self);
+}
+
bool Stack_any(Stack* self)
{
return self->length > 0;
bool Stack_any(Stack* self)
{
return self->length > 0;