OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [runtime/] [mem.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2009 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package runtime
6
 
7
import "unsafe"
8
 
9
// A MemStats records statistics about the memory allocator.
10
type MemStats struct {
11
        // General statistics.
12
        Alloc      uint64 // bytes allocated and still in use
13
        TotalAlloc uint64 // bytes allocated (even if freed)
14
        Sys        uint64 // bytes obtained from system (should be sum of XxxSys below)
15
        Lookups    uint64 // number of pointer lookups
16
        Mallocs    uint64 // number of mallocs
17
        Frees      uint64 // number of frees
18
 
19
        // Main allocation heap statistics.
20
        HeapAlloc   uint64 // bytes allocated and still in use
21
        HeapSys     uint64 // bytes obtained from system
22
        HeapIdle    uint64 // bytes in idle spans
23
        HeapInuse   uint64 // bytes in non-idle span
24
        HeapObjects uint64 // total number of allocated objects
25
 
26
        // Low-level fixed-size structure allocator statistics.
27
        //      Inuse is bytes used now.
28
        //      Sys is bytes obtained from system.
29
        StackInuse  uint64 // bootstrap stacks
30
        StackSys    uint64
31
        MSpanInuse  uint64 // mspan structures
32
        MSpanSys    uint64
33
        MCacheInuse uint64 // mcache structures
34
        MCacheSys   uint64
35
        BuckHashSys uint64 // profiling bucket hash table
36
 
37
        // Garbage collector statistics.
38
        NextGC       uint64
39
        PauseTotalNs uint64
40
        PauseNs      [256]uint64 // most recent GC pause times
41
        NumGC        uint32
42
        EnableGC     bool
43
        DebugGC      bool
44
 
45
        // Per-size allocation statistics.
46
        // 61 is NumSizeClasses in the C code.
47
        BySize [61]struct {
48
                Size    uint32
49
                Mallocs uint64
50
                Frees   uint64
51
        }
52
}
53
 
54
var Sizeof_C_MStats uintptr // filled in by malloc.goc
55
 
56
var VmemStats MemStats
57
 
58
func init() {
59
        if Sizeof_C_MStats != unsafe.Sizeof(VmemStats) {
60
                println(Sizeof_C_MStats, unsafe.Sizeof(VmemStats))
61
                panic("MStats vs MemStatsType size mismatch")
62
        }
63
}
64
 
65
// ReadMemStats populates m with memory allocator statistics.
66
func ReadMemStats(m *MemStats)
67
 
68
// GC runs a garbage collection.
69
func GC()

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.