diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-09-16 15:47:21 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-09-16 15:47:21 +0000 |
commit | adb0401dac41c81571722312d4586b2693f95aa6 (patch) | |
tree | ea2b52e3c258d6b6d9356977c683c7f72a4a5fd5 /libgo/runtime/malloc.h | |
parent | 5548ca3540bccbc908a45942896d635ea5f1c23f (diff) | |
download | gcc-adb0401dac41c81571722312d4586b2693f95aa6.zip gcc-adb0401dac41c81571722312d4586b2693f95aa6.tar.gz gcc-adb0401dac41c81571722312d4586b2693f95aa6.tar.bz2 |
Update Go library to r60.
From-SVN: r178910
Diffstat (limited to 'libgo/runtime/malloc.h')
-rw-r--r-- | libgo/runtime/malloc.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libgo/runtime/malloc.h b/libgo/runtime/malloc.h index 8131e96..3e813bb 100644 --- a/libgo/runtime/malloc.h +++ b/libgo/runtime/malloc.h @@ -80,7 +80,6 @@ // This C code was written with an eye toward translating to Go // in the future. Methods have the form Type_Method(Type *t, ...). -typedef struct FixAlloc FixAlloc; typedef struct MCentral MCentral; typedef struct MHeap MHeap; typedef struct MSpan MSpan; @@ -186,10 +185,10 @@ void runtime_FixAlloc_Free(FixAlloc *f, void *p); // Shared with Go: if you edit this structure, also edit extern.go. struct MStats { - // General statistics. No locking; approximate. + // General statistics. uint64 alloc; // bytes allocated and still in use uint64 total_alloc; // bytes allocated (even if freed) - uint64 sys; // bytes obtained from system (should be sum of xxx_sys below) + uint64 sys; // bytes obtained from system (should be sum of xxx_sys below, no locking, approximate) uint64 nlookup; // number of pointer lookups uint64 nmalloc; // number of mallocs uint64 nfree; // number of frees @@ -222,7 +221,6 @@ struct MStats bool debuggc; // Statistics about allocation size classes. - // No locking; approximate. struct { uint32 size; uint64 nmalloc; @@ -268,9 +266,20 @@ struct MCache { MCacheList list[NumSizeClasses]; uint64 size; + int64 local_cachealloc; // bytes allocated (or freed) from cache since last lock of heap + int64 local_objects; // objects allocated (or freed) from cache since last lock of heap int64 local_alloc; // bytes allocated (or freed) since last lock of heap - int64 local_objects; // objects allocated (or freed) since last lock of heap + int64 local_total_alloc; // bytes allocated (even if freed) since last lock of heap + int64 local_nmalloc; // number of mallocs since last lock of heap + int64 local_nfree; // number of frees since last lock of heap + int64 local_nlookup; // number of pointer lookups since last lock of heap int32 next_sample; // trigger heap sample after allocating this many bytes + // Statistics about allocation size classes since last lock of heap + struct { + int64 nmalloc; + int64 nfree; + } local_by_size[NumSizeClasses]; + }; void* runtime_MCache_Alloc(MCache *c, int32 sizeclass, uintptr size, int32 zeroed); @@ -379,6 +388,7 @@ void runtime_markspan(void *v, uintptr size, uintptr n, bool leftover); void runtime_unmarkspan(void *v, uintptr size); bool runtime_blockspecial(void*); void runtime_setblockspecial(void*); +void runtime_purgecachedstats(M*); enum { |