aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2013-05-31 10:42:30 +0400
committerDmitriy Vyukov <dvyukov@google.com>2013-05-31 10:42:30 +0400
commit86da989ee53f85044c04a418e5ec30e111d169b0 (patch)
treed5ef9f48f881179b1d430176555c36217eb077aa /src/pkg/runtime/malloc.h
parentd6f89d735e66c7b955f262d38ba95f5e9a793b95 (diff)
downloadgo-86da989ee53f85044c04a418e5ec30e111d169b0.tar.xz
runtime: introduce helper persistentalloc() function
It is a caching wrapper around SysAlloc() that can allocate small chunks. Use it for symtab allocations. Reduces number of symtab walks from 4 to 3 (reduces buildfuncs time from 10ms to 7.5ms on a large binary, reduces initial heap size by 680K on the same binary). Also can be used for type info allocation, itab allocation. There are also several places in GC where we do the same thing, they can be changed to use persistentalloc(). Also can be used in FixAlloc, because each instance of FixAlloc allocates in 128K regions, which is too eager. Reincarnation of committed and rolled back https://golang.org/cl/9805043 The latent bugs that it revealed are fixed: https://golang.org/cl/9837049 https://golang.org/cl/9778048 R=golang-dev, khr CC=golang-dev https://golang.org/cl/9778049
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index 0d22075bea..3338b0946f 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -447,6 +447,7 @@ void runtime·MHeap_MapSpans(MHeap *h);
void runtime·MHeap_Scavenger(void);
void* runtime·mallocgc(uintptr size, uint32 flag, int32 dogc, int32 zeroed);
+void* runtime·persistentalloc(uintptr size, uintptr align);
int32 runtime·mlookup(void *v, byte **base, uintptr *size, MSpan **s);
void runtime·gc(int32 force);
void runtime·markallocated(void *v, uintptr n, bool noptr);