Skip to content

Commit bb81f05

Browse files
committed
refer to xudi.
1 parent fa99471 commit bb81f05

9 files changed

Lines changed: 987 additions & 3 deletions

File tree

‎runtime/control.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#include "control.h"
22

3-
int Control_heapSize = 2080;
3+
int Control_heapSize = 2*1400;

‎runtime/gc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void dump_heap()
7979
fprintf(stderr, "%8x heap.to \n", heap.to);
8080
fprintf(stderr, "%8x heap.toStart \n", heap.toStart);
8181
fprintf(stderr, "%8x heap.toNext \n", heap.toNext);
82-
fprintf(stderr, "%8x ::: heap.usedFrom \n", heap.fromFree - heap.from);
82+
fprintf(stderr, "%8x %d::: heap.usedFrom \n", heap.fromFree - heap.from, heap.fromFree - heap.from);
8383
fprintf(stderr, "%8x ::: heap.usedTo \n", heap.toNext - heap.to);
8484

8585
}
@@ -607,7 +607,7 @@ static void Tiger_gc ()
607607
fprintf(stderr, "I am here.....................\n");
608608
dump_heap();
609609
clock_t stop = clock();
610-
fprintf(stderr, "GC: round %d, cost %d clocks collected %d(0x%x) bytes. size: 0x%x\n", ++round, (stop - start),
610+
fprintf(stderr, "GC: round %d, cost %d clocks collected %d(0x%x) bytes. size: 0x%x\n", round, (stop - start),
611611
(heap.fromFree - heap.from) - (heap.toNext - heap.to), (heap.fromFree - heap.from) - (heap.toNext - heap.to), heap.size);
612612
printf("GC: round %d, cost %d clocks collected %d(0x%x) bytes. size: 0x%x\n", ++round, (stop - start),
613613
(heap.fromFree - heap.from) - (heap.toNext - heap.to), (heap.fromFree - heap.from) - (heap.toNext - heap.to), heap.size);

‎test/2.lgo‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
==================================================
2+
test starting
3+
=============
4+
5+
D:\tiger\TigerLab\test>java -cp ../bin Tiger -codegen C Triger_gc1.java
6+
7+
D:\tiger\TigerLab\test>gcc ../runtime/runtime.c Triger_gc1.java.c -o Triger_gc1
8+
9+
D:\tiger\TigerLab\test>Triger_gc1.exe
10+
��ֹ������������(Y/N)?
11+
=============
12+
test finished
13+
==================================================

0 commit comments

Comments
 (0)