diff options
| author | Russ Cox <rsc@golang.org> | 2013-03-14 10:10:12 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2013-03-14 10:10:12 -0400 |
| commit | f84d5dd4753890f32947e67c8a16d8ca22086551 (patch) | |
| tree | e987436cbf0a22f9b9b130e8d3db5d6b73f56e7d /src/pkg/runtime/mfixalloc.c | |
| parent | 5b79aa82ff136e789287cea43e3e49542a9be215 (diff) | |
| download | go-f84d5dd4753890f32947e67c8a16d8ca22086551.tar.xz | |
runtime: make panic possible before malloc is ready
Otherwise startup problems can be difficult to debug.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7522046
Diffstat (limited to 'src/pkg/runtime/mfixalloc.c')
| -rw-r--r-- | src/pkg/runtime/mfixalloc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pkg/runtime/mfixalloc.c b/src/pkg/runtime/mfixalloc.c index c916d588fd..c7dab8aea8 100644 --- a/src/pkg/runtime/mfixalloc.c +++ b/src/pkg/runtime/mfixalloc.c @@ -30,6 +30,11 @@ void* runtime·FixAlloc_Alloc(FixAlloc *f) { void *v; + + if(f->size == 0) { + runtime·printf("runtime: use of FixAlloc_Alloc before FixAlloc_Init\n"); + runtime·throw("runtime: internal error"); + } if(f->list) { v = f->list; |
