LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Garbage collector (GC). | 5 // Garbage collector (GC). |
6 // | 6 // |
7 // GC is: | 7 // GC is: |
8 // - mark&sweep | 8 // - mark&sweep |
9 // - mostly precise (with the exception of some C-allocated objects, assembly fr
ames/arguments, etc) | 9 // - mostly precise (with the exception of some C-allocated objects, assembly fr
ames/arguments, etc) |
10 // - parallel (up to MaxGcproc threads) | 10 // - parallel (up to MaxGcproc threads) |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 struct SweepData | 1044 struct SweepData |
1045 { | 1045 { |
1046 G* g; | 1046 G* g; |
1047 bool parked; | 1047 bool parked; |
1048 | 1048 |
1049 uint32 spanidx; // background sweeper position | 1049 uint32 spanidx; // background sweeper position |
1050 | 1050 |
1051 uint32 nbgsweep; | 1051 uint32 nbgsweep; |
1052 uint32 npausesweep; | 1052 uint32 npausesweep; |
1053 }; | 1053 }; |
1054 | |
1055 SweepData runtime·sweep; | 1054 SweepData runtime·sweep; |
1056 | 1055 |
1057 // sweeps one span | 1056 // sweeps one span |
1058 // returns number of pages returned to heap, or -1 if there is nothing to sweep | 1057 // returns number of pages returned to heap, or -1 if there is nothing to sweep |
1059 uintptr | 1058 uintptr |
1060 runtime·sweepone(void) | 1059 runtime·sweepone(void) |
1061 { | 1060 { |
1062 MSpan *s; | 1061 MSpan *s; |
1063 uint32 idx, sg; | 1062 uint32 idx, sg; |
1064 uintptr npages; | 1063 uintptr npages; |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 void runtime·gc_unixnanotime(int64 *now); | 1917 void runtime·gc_unixnanotime(int64 *now); |
1919 | 1918 |
1920 int64 | 1919 int64 |
1921 runtime·unixnanotime(void) | 1920 runtime·unixnanotime(void) |
1922 { | 1921 { |
1923 int64 now; | 1922 int64 now; |
1924 | 1923 |
1925 runtime·gc_unixnanotime(&now); | 1924 runtime·gc_unixnanotime(&now); |
1926 return now; | 1925 return now; |
1927 } | 1926 } |
LEFT | RIGHT |