diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2014-01-28 00:26:56 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2014-01-28 00:26:56 +0400 |
| commit | 86a3a542844a8c6040656006697e16b207c1d3f6 (patch) | |
| tree | 73f90feb6f5da4c7d29e19a05f0e5b3d245bb793 /src/pkg/runtime/malloc.h | |
| parent | 179d41feccc29260d1a16294647df218f1a6746a (diff) | |
| download | go-86a3a542844a8c6040656006697e16b207c1d3f6.tar.xz | |
runtime: fix windows build
Currently windows crashes because early allocs in schedinit
try to allocate tiny memory blocks, but m->p is not yet setup.
I've considered calling procresize(1) earlier in schedinit,
but this refactoring is better and must fix the issue as well.
Fixes #7218.
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/54570045
Diffstat (limited to 'src/pkg/runtime/malloc.h')
| -rw-r--r-- | src/pkg/runtime/malloc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index 4146299223..52a23e391c 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -296,6 +296,10 @@ struct MCache // so they are grouped here for better caching. int32 next_sample; // trigger heap sample after allocating this many bytes intptr local_cachealloc; // bytes allocated (or freed) from cache since last lock of heap + // Allocator cache for tiny objects w/o pointers. + // See "Tiny allocator" comment in malloc.goc. + byte* tiny; + uintptr tinysize; // The rest is not accessed on every malloc. MCacheList list[NumSizeClasses]; // Local allocator stats, flushed during GC. |
