summaryrefslogtreecommitdiffstats
path: root/libgo/runtime/mgc0.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-24 20:44:34 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-24 20:44:34 +0000
commitea45cfe0dc0fa4d0d6c825be28e876d52b28afa8 (patch)
tree6376f98a68555af3b62356fcc2d0f7b310afa452 /libgo/runtime/mgc0.c
parent409e1a55993328bd0c14946f26b328c2e5d5b45c (diff)
downloadppe42-gcc-ea45cfe0dc0fa4d0d6c825be28e876d52b28afa8.tar.gz
ppe42-gcc-ea45cfe0dc0fa4d0d6c825be28e876d52b28afa8.zip
runtime: Copy runtime_printf from other Go library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187848 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/runtime/mgc0.c')
-rw-r--r--libgo/runtime/mgc0.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/libgo/runtime/mgc0.c b/libgo/runtime/mgc0.c
index c08d5c1548e..c84bdd67821 100644
--- a/libgo/runtime/mgc0.c
+++ b/libgo/runtime/mgc0.c
@@ -159,7 +159,7 @@ scanblock(byte *b, int64 n)
bool keepworking;
if((int64)(uintptr)n != n || n < 0) {
- // runtime_printf("scanblock %p %lld\n", b, (long long)n);
+ runtime_printf("scanblock %p %D\n", b, n);
runtime_throw("scanblock");
}
@@ -190,7 +190,7 @@ scanblock(byte *b, int64 n)
// Each iteration scans the block b of length n, queueing pointers in
// the work buffer.
if(Debug > 1)
- runtime_printf("scanblock %p %lld\n", b, (long long) n);
+ runtime_printf("scanblock %p %D\n", b, n);
vp = (void**)b;
n >>= (2+PtrSize/8); /* n /= PtrSize (4 or 8) */
@@ -346,7 +346,7 @@ debug_scanblock(byte *b, int64 n)
runtime_throw("debug_scanblock without DebugMark");
if((int64)(uintptr)n != n || n < 0) {
- //runtime_printf("debug_scanblock %p %D\n", b, n);
+ runtime_printf("debug_scanblock %p %D\n", b, n);
runtime_throw("debug_scanblock");
}
@@ -1047,14 +1047,13 @@ runtime_gc(int32 force)
mstats.pause_total_ns += t3 - t0;
mstats.numgc++;
if(mstats.debuggc)
- runtime_printf("pause %llu\n", (unsigned long long)t3-t0);
+ runtime_printf("pause %D\n", t3-t0);
if(gctrace) {
- runtime_printf("gc%d(%d): %llu+%llu+%llu ms %llu -> %llu MB %llu -> %llu (%llu-%llu) objects %llu handoff\n",
- mstats.numgc, work.nproc, (unsigned long long)(t1-t0)/1000000, (unsigned long long)(t2-t1)/1000000, (unsigned long long)(t3-t2)/1000000,
- (unsigned long long)heap0>>20, (unsigned long long)heap1>>20, (unsigned long long)obj0, (unsigned long long)obj1,
- (unsigned long long) mstats.nmalloc, (unsigned long long)mstats.nfree,
- (unsigned long long) nhandoff);
+ runtime_printf("gc%d(%d): %D+%D+%D ms, %D -> %D MB %D -> %D (%D-%D) objects\n",
+ mstats.numgc, work.nproc, (t1-t0)/1000000, (t2-t1)/1000000, (t3-t2)/1000000,
+ heap0>>20, heap1>>20, obj0, obj1,
+ mstats.nmalloc, mstats.nfree);
}
runtime_MProf_GC();
@@ -1152,8 +1151,8 @@ runtime_markallocated(void *v, uintptr n, bool noptr)
{
uintptr *b, obits, bits, off, shift;
- // if(0)
- // runtime_printf("markallocated %p+%p\n", v, n);
+ if(0)
+ runtime_printf("markallocated %p+%p\n", v, n);
if((byte*)v+n > (byte*)runtime_mheap.arena_used || (byte*)v < runtime_mheap.arena_start)
runtime_throw("markallocated: bad pointer");
@@ -1184,8 +1183,8 @@ runtime_markfreed(void *v, uintptr n)
{
uintptr *b, obits, bits, off, shift;
- // if(0)
- // runtime_printf("markallocated %p+%p\n", v, n);
+ if(0)
+ runtime_printf("markallocated %p+%p\n", v, n);
if((byte*)v+n > (byte*)runtime_mheap.arena_used || (byte*)v < runtime_mheap.arena_start)
runtime_throw("markallocated: bad pointer");
@@ -1227,7 +1226,7 @@ runtime_checkfreed(void *v, uintptr n)
bits = *b>>shift;
if((bits & bitAllocated) != 0) {
runtime_printf("checkfreed %p+%p: off=%p have=%p\n",
- v, (void*)n, (void*)off, (void*)(bits & bitMask));
+ v, n, off, bits & bitMask);
runtime_throw("checkfreed: not freed");
}
}
OpenPOWER on IntegriCloud