diff options
| author | Jan Ziak <0xe2.0x9a.0x9b@gmail.com> | 2013-05-27 08:11:59 +0200 |
|---|---|---|
| committer | Jan Ziak <0xe2.0x9a.0x9b@gmail.com> | 2013-05-27 08:11:59 +0200 |
| commit | e017e0cb24f9c5ea4c0e2b7479e4b411e4882dcf (patch) | |
| tree | 73ec7950d22b460dbeeb5f3df6ebe1fa98fe8104 /src/pkg/runtime/os_linux.c | |
| parent | 20c524c5e29282d3c91e8155c496865dee2c3c73 (diff) | |
| download | go-e017e0cb24f9c5ea4c0e2b7479e4b411e4882dcf.tar.xz | |
runtime: flag static variables as no-pointers
Variables in data sections of 32-bit executables interfere with
garbage collector's ability to free objects and/or unnecessarily
slow down the garbage collector.
This changeset moves some static variables to .noptr sections.
'files' in symtab.c is now allocated dynamically.
R=golang-dev, dvyukov, minux.ma
CC=golang-dev
https://golang.org/cl/9786044
Diffstat (limited to 'src/pkg/runtime/os_linux.c')
| -rw-r--r-- | src/pkg/runtime/os_linux.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/runtime/os_linux.c b/src/pkg/runtime/os_linux.c index 6b86d2b177..6bb376a7e9 100644 --- a/src/pkg/runtime/os_linux.c +++ b/src/pkg/runtime/os_linux.c @@ -172,6 +172,7 @@ runtime·get_random_data(byte **rnd, int32 *rnd_len) *rnd = runtime·startup_random_data; *rnd_len = runtime·startup_random_data_len; } else { + #pragma dataflag 16 // no pointers static byte urandom_data[HashRandomBytes]; int32 fd; fd = runtime·open("/dev/urandom", 0 /* O_RDONLY */, 0); @@ -283,6 +284,7 @@ runtime·setprof(bool on) USED(on); } +#pragma dataflag 16 // no pointers static int8 badcallback[] = "runtime: cgo callback on thread not created by Go.\n"; // This runs on a foreign stack, without an m or a g. No stack split. @@ -293,6 +295,7 @@ runtime·badcallback(void) runtime·write(2, badcallback, sizeof badcallback - 1); } +#pragma dataflag 16 // no pointers static int8 badsignal[] = "runtime: signal received on thread not created by Go: "; // This runs on a foreign stack, without an m or a g. No stack split. |
