-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add boehm gc program compiling example * add file * update Makefile * try to build the boehm example in CI * install package * try to fix package * unify make file * fix -l arg
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,12 +118,15 @@ jobs: | |
- '8' | ||
steps: | ||
- uses: "actions/[email protected]" | ||
- name: "install boehm" | ||
run: "sudo apt-get update && sudo apt install -y libgc1 libgc-dev" | ||
- name: "test runtime code" | ||
run: | | ||
cd c_runtime | ||
rm -f test_exe | ||
make && git diff --quiet || { git diff; false; } | ||
./test_exe && cd .. | ||
make boehm_example | ||
./test_exe && ./boehm_example && cd .. | ||
- name: "build assembly" | ||
run: "sbt \"++${{matrix.scala}}; cli/assembly\"" | ||
- name: "generate c code" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "gc.h" | ||
#include <assert.h> | ||
#include <stdio.h> | ||
|
||
int main(void) { | ||
int i; | ||
|
||
GC_INIT(); | ||
for (i = 0; i < 10000000; ++i) { | ||
int **p = (int **) GC_MALLOC(sizeof(int *)); | ||
int *q = (int *) GC_MALLOC_ATOMIC(sizeof(int)); | ||
assert(*p == 0); | ||
*p = (int *) GC_REALLOC(q, 2 * sizeof(int)); | ||
if (i % 100000 == 0) | ||
printf("Heap size = %lu bytes\n", | ||
(unsigned long)GC_get_heap_size()); | ||
} | ||
return 0; | ||
} |