2008-06-05 20:38:39 -06:00
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
#include "runtime.h"
|
2012-04-05 08:47:43 -06:00
|
|
|
|
#include "arch_GOARCH.h"
|
2008-06-05 20:38:39 -06:00
|
|
|
|
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
enum {
|
|
|
|
|
maxround = sizeof(uintptr),
|
|
|
|
|
};
|
|
|
|
|
|
2011-07-25 22:52:46 -06:00
|
|
|
|
/*
|
|
|
|
|
* We assume that all architectures turn faults and the like
|
|
|
|
|
* into apparent calls to runtime.sigpanic. If we see a "call"
|
|
|
|
|
* to runtime.sigpanic, we do not back up the PC to find the
|
|
|
|
|
* line number of the CALL instruction, because there is no CALL.
|
|
|
|
|
*/
|
|
|
|
|
void runtime·sigpanic(void);
|
|
|
|
|
|
2008-09-22 14:47:53 -06:00
|
|
|
|
int32
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·gotraceback(void)
|
2008-09-22 14:47:53 -06:00
|
|
|
|
{
|
|
|
|
|
byte *p;
|
|
|
|
|
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
p = runtime·getenv("GOTRACEBACK");
|
2008-09-22 14:47:53 -06:00
|
|
|
|
if(p == nil || p[0] == '\0')
|
|
|
|
|
return 1; // default is on
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
return runtime·atoi(p);
|
2008-09-22 14:47:53 -06:00
|
|
|
|
}
|
|
|
|
|
|
2009-01-26 13:36:21 -07:00
|
|
|
|
int32
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·mcmp(byte *s1, byte *s2, uint32 n)
|
2009-01-26 13:36:21 -07:00
|
|
|
|
{
|
|
|
|
|
uint32 i;
|
|
|
|
|
byte c1, c2;
|
|
|
|
|
|
|
|
|
|
for(i=0; i<n; i++) {
|
|
|
|
|
c1 = s1[i];
|
|
|
|
|
c2 = s2[i];
|
|
|
|
|
if(c1 < c2)
|
|
|
|
|
return -1;
|
|
|
|
|
if(c1 > c2)
|
|
|
|
|
return +1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-11-23 18:08:55 -07:00
|
|
|
|
byte*
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·mchr(byte *p, byte c, byte *ep)
|
2008-11-23 18:08:55 -07:00
|
|
|
|
{
|
|
|
|
|
for(; p < ep; p++)
|
|
|
|
|
if(*p == c)
|
|
|
|
|
return p;
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
2008-06-30 16:30:47 -06:00
|
|
|
|
static int32 argc;
|
|
|
|
|
static uint8** argv;
|
2009-01-16 15:58:14 -07:00
|
|
|
|
|
2009-08-25 16:54:25 -06:00
|
|
|
|
Slice os·Args;
|
2011-11-14 12:06:50 -07:00
|
|
|
|
Slice syscall·envs;
|
2008-06-30 16:30:47 -06:00
|
|
|
|
|
2012-08-31 16:07:04 -06:00
|
|
|
|
void (*runtime·sysargs)(int32, uint8**);
|
|
|
|
|
|
2008-06-30 16:30:47 -06:00
|
|
|
|
void
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·args(int32 c, uint8 **v)
|
2008-06-30 16:30:47 -06:00
|
|
|
|
{
|
|
|
|
|
argc = c;
|
|
|
|
|
argv = v;
|
2012-08-31 16:07:04 -06:00
|
|
|
|
if(runtime·sysargs != nil)
|
|
|
|
|
runtime·sysargs(c, v);
|
2008-06-30 16:30:47 -06:00
|
|
|
|
}
|
|
|
|
|
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
int32 runtime·isplan9;
|
2011-01-20 08:22:20 -07:00
|
|
|
|
int32 runtime·iswindows;
|
2010-10-18 10:32:55 -06:00
|
|
|
|
|
2009-01-16 15:58:14 -07:00
|
|
|
|
void
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·goargs(void)
|
2008-08-04 17:43:49 -06:00
|
|
|
|
{
|
2011-01-11 17:48:15 -07:00
|
|
|
|
String *s;
|
|
|
|
|
int32 i;
|
2012-03-15 20:17:54 -06:00
|
|
|
|
|
2010-12-15 18:18:18 -07:00
|
|
|
|
// for windows implementation see "os" package
|
|
|
|
|
if(Windows)
|
|
|
|
|
return;
|
|
|
|
|
|
2011-01-11 17:48:15 -07:00
|
|
|
|
s = runtime·malloc(argc*sizeof s[0]);
|
2009-01-26 18:37:05 -07:00
|
|
|
|
for(i=0; i<argc; i++)
|
2011-01-11 17:48:15 -07:00
|
|
|
|
s[i] = runtime·gostringnocopy(argv[i]);
|
|
|
|
|
os·Args.array = (byte*)s;
|
2009-08-25 16:54:25 -06:00
|
|
|
|
os·Args.len = argc;
|
2009-05-08 16:21:41 -06:00
|
|
|
|
os·Args.cap = argc;
|
2011-01-11 17:48:15 -07:00
|
|
|
|
}
|
2009-01-16 15:58:14 -07:00
|
|
|
|
|
2011-01-11 17:48:15 -07:00
|
|
|
|
void
|
|
|
|
|
runtime·goenvs_unix(void)
|
|
|
|
|
{
|
|
|
|
|
String *s;
|
|
|
|
|
int32 i, n;
|
2012-03-15 20:17:54 -06:00
|
|
|
|
|
2011-01-11 17:48:15 -07:00
|
|
|
|
for(n=0; argv[argc+1+n] != 0; n++)
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
s = runtime·malloc(n*sizeof s[0]);
|
|
|
|
|
for(i=0; i<n; i++)
|
|
|
|
|
s[i] = runtime·gostringnocopy(argv[argc+1+i]);
|
2011-11-14 12:06:50 -07:00
|
|
|
|
syscall·envs.array = (byte*)s;
|
|
|
|
|
syscall·envs.len = n;
|
|
|
|
|
syscall·envs.cap = n;
|
2008-08-04 17:43:49 -06:00
|
|
|
|
}
|
|
|
|
|
|
2010-03-17 00:10:33 -06:00
|
|
|
|
void
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·getgoroot(String out)
|
2010-03-17 00:10:33 -06:00
|
|
|
|
{
|
|
|
|
|
byte *p;
|
2010-03-24 10:40:09 -06:00
|
|
|
|
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
p = runtime·getenv("GOROOT");
|
|
|
|
|
out = runtime·gostringnocopy(p);
|
2010-03-17 00:10:33 -06:00
|
|
|
|
FLUSH(&out);
|
|
|
|
|
}
|
2009-01-16 15:58:14 -07:00
|
|
|
|
|
2008-08-04 17:43:49 -06:00
|
|
|
|
int32
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·atoi(byte *p)
|
2008-08-04 17:43:49 -06:00
|
|
|
|
{
|
|
|
|
|
int32 n;
|
2008-08-05 15:21:42 -06:00
|
|
|
|
|
2008-08-04 17:43:49 -06:00
|
|
|
|
n = 0;
|
|
|
|
|
while('0' <= *p && *p <= '9')
|
|
|
|
|
n = n*10 + *p++ - '0';
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-05 08:47:43 -06:00
|
|
|
|
static void
|
|
|
|
|
TestAtomic64(void)
|
|
|
|
|
{
|
|
|
|
|
uint64 z64, x64;
|
|
|
|
|
|
|
|
|
|
z64 = 42;
|
|
|
|
|
x64 = 0;
|
|
|
|
|
PREFETCH(&z64);
|
|
|
|
|
if(runtime·cas64(&z64, &x64, 1))
|
|
|
|
|
runtime·throw("cas64 failed");
|
|
|
|
|
if(x64 != 42)
|
|
|
|
|
runtime·throw("cas64 failed");
|
|
|
|
|
if(!runtime·cas64(&z64, &x64, 1))
|
|
|
|
|
runtime·throw("cas64 failed");
|
|
|
|
|
if(x64 != 42 || z64 != 1)
|
|
|
|
|
runtime·throw("cas64 failed");
|
|
|
|
|
if(runtime·atomicload64(&z64) != 1)
|
|
|
|
|
runtime·throw("load64 failed");
|
|
|
|
|
runtime·atomicstore64(&z64, (1ull<<40)+1);
|
|
|
|
|
if(runtime·atomicload64(&z64) != (1ull<<40)+1)
|
|
|
|
|
runtime·throw("store64 failed");
|
|
|
|
|
if(runtime·xadd64(&z64, (1ull<<40)+1) != (2ull<<40)+2)
|
|
|
|
|
runtime·throw("xadd64 failed");
|
|
|
|
|
if(runtime·atomicload64(&z64) != (2ull<<40)+2)
|
|
|
|
|
runtime·throw("xadd64 failed");
|
2013-03-05 00:46:52 -07:00
|
|
|
|
if(runtime·xchg64(&z64, (3ull<<40)+3) != (2ull<<40)+2)
|
|
|
|
|
runtime·throw("xchg64 failed");
|
|
|
|
|
if(runtime·atomicload64(&z64) != (3ull<<40)+3)
|
|
|
|
|
runtime·throw("xchg64 failed");
|
2012-04-05 08:47:43 -06:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-05 15:18:47 -06:00
|
|
|
|
void
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·check(void)
|
2008-06-30 16:30:47 -06:00
|
|
|
|
{
|
|
|
|
|
int8 a;
|
|
|
|
|
uint8 b;
|
|
|
|
|
int16 c;
|
|
|
|
|
uint16 d;
|
|
|
|
|
int32 e;
|
|
|
|
|
uint32 f;
|
|
|
|
|
int64 g;
|
|
|
|
|
uint64 h;
|
2012-01-26 14:25:07 -07:00
|
|
|
|
float32 i, i1;
|
|
|
|
|
float64 j, j1;
|
2008-06-30 16:30:47 -06:00
|
|
|
|
void* k;
|
|
|
|
|
uint16* l;
|
2010-12-13 14:22:19 -07:00
|
|
|
|
struct x1 {
|
|
|
|
|
byte x;
|
|
|
|
|
};
|
|
|
|
|
struct y1 {
|
|
|
|
|
struct x1 x1;
|
|
|
|
|
byte y;
|
|
|
|
|
};
|
2008-06-30 16:30:47 -06:00
|
|
|
|
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
if(sizeof(a) != 1) runtime·throw("bad a");
|
|
|
|
|
if(sizeof(b) != 1) runtime·throw("bad b");
|
|
|
|
|
if(sizeof(c) != 2) runtime·throw("bad c");
|
|
|
|
|
if(sizeof(d) != 2) runtime·throw("bad d");
|
|
|
|
|
if(sizeof(e) != 4) runtime·throw("bad e");
|
|
|
|
|
if(sizeof(f) != 4) runtime·throw("bad f");
|
|
|
|
|
if(sizeof(g) != 8) runtime·throw("bad g");
|
|
|
|
|
if(sizeof(h) != 8) runtime·throw("bad h");
|
|
|
|
|
if(sizeof(i) != 4) runtime·throw("bad i");
|
|
|
|
|
if(sizeof(j) != 8) runtime·throw("bad j");
|
|
|
|
|
if(sizeof(k) != sizeof(uintptr)) runtime·throw("bad k");
|
|
|
|
|
if(sizeof(l) != sizeof(uintptr)) runtime·throw("bad l");
|
2010-12-13 14:22:19 -07:00
|
|
|
|
if(sizeof(struct x1) != 1) runtime·throw("bad sizeof x1");
|
|
|
|
|
if(offsetof(struct y1, y) != 1) runtime·throw("bad offsetof y1.y");
|
|
|
|
|
if(sizeof(struct y1) != 2) runtime·throw("bad sizeof y1");
|
2008-08-04 17:43:49 -06:00
|
|
|
|
|
|
|
|
|
uint32 z;
|
|
|
|
|
z = 1;
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
if(!runtime·cas(&z, 1, 2))
|
|
|
|
|
runtime·throw("cas1");
|
2008-08-04 17:43:49 -06:00
|
|
|
|
if(z != 2)
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·throw("cas2");
|
2008-08-05 15:21:42 -06:00
|
|
|
|
|
2008-08-04 17:43:49 -06:00
|
|
|
|
z = 4;
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
if(runtime·cas(&z, 5, 6))
|
|
|
|
|
runtime·throw("cas3");
|
2008-08-04 17:43:49 -06:00
|
|
|
|
if(z != 4)
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·throw("cas4");
|
2008-08-04 17:43:49 -06:00
|
|
|
|
|
2012-01-26 14:25:07 -07:00
|
|
|
|
*(uint64*)&j = ~0ULL;
|
|
|
|
|
if(j == j)
|
|
|
|
|
runtime·throw("float64nan");
|
|
|
|
|
if(!(j != j))
|
|
|
|
|
runtime·throw("float64nan1");
|
|
|
|
|
|
|
|
|
|
*(uint64*)&j1 = ~1ULL;
|
|
|
|
|
if(j == j1)
|
|
|
|
|
runtime·throw("float64nan2");
|
|
|
|
|
if(!(j != j1))
|
|
|
|
|
runtime·throw("float64nan3");
|
|
|
|
|
|
|
|
|
|
*(uint32*)&i = ~0UL;
|
|
|
|
|
if(i == i)
|
|
|
|
|
runtime·throw("float32nan");
|
|
|
|
|
if(!(i != i))
|
|
|
|
|
runtime·throw("float32nan1");
|
|
|
|
|
|
|
|
|
|
*(uint32*)&i1 = ~1UL;
|
|
|
|
|
if(i == i1)
|
|
|
|
|
runtime·throw("float32nan2");
|
|
|
|
|
if(!(i != i1))
|
|
|
|
|
runtime·throw("float32nan3");
|
2012-04-05 08:47:43 -06:00
|
|
|
|
|
|
|
|
|
TestAtomic64();
|
2008-06-30 16:30:47 -06:00
|
|
|
|
}
|
2008-07-08 18:19:17 -06:00
|
|
|
|
|
2010-03-23 18:01:17 -06:00
|
|
|
|
void
|
2012-09-24 12:58:34 -06:00
|
|
|
|
runtime·Caller(intgo skip, uintptr retpc, String retfile, intgo retline, bool retbool)
|
2010-03-23 18:01:17 -06:00
|
|
|
|
{
|
2011-07-25 22:52:46 -06:00
|
|
|
|
Func *f, *g;
|
runtime: more detailed panic traces, line number work
Follow morestack, so that crashes during a stack split
give complete traces. Also mark stack segment boundaries
as an aid to debugging.
Correct various line number bugs with yet another attempt
at interpreting the pc/ln table. This one has a chance at
being correct, because I based it on reading src/cmd/ld/lib.c
instead of on reading the documentation.
Fixes #1138.
Fixes #1430.
Fixes #1461.
throw: runtime: split stack overflow
runtime.throw+0x3e /home/rsc/g/go2/src/pkg/runtime/runtime.c:78
runtime.throw(0x81880af, 0xf75c8b18)
runtime.newstack+0xad /home/rsc/g/go2/src/pkg/runtime/proc.c:728
runtime.newstack()
runtime.morestack+0x4f /home/rsc/g/go2/src/pkg/runtime/386/asm.s:184
runtime.morestack()
----- morestack called from stack: -----
runtime.new+0x1a /home/rsc/g/go2/src/pkg/runtime/malloc.c:288
runtime.new(0x1, 0x0, 0x0)
gongo.makeBoard+0x33 /tmp/Gongo/gongo_robot_test.go:344
gongo.makeBoard(0x809d238, 0x1, 0xf76092c8, 0x1)
----- stack segment boundary -----
gongo.checkEasyScore+0xcc /tmp/Gongo/gongo_robot_test.go:287
gongo.checkEasyScore(0xf764b710, 0x0, 0x809d238, 0x1)
gongo.TestEasyScore+0x8c /tmp/Gongo/gongo_robot_test.go:255
gongo.TestEasyScore(0xf764b710, 0x818a990)
testing.tRunner+0x2f /home/rsc/g/go2/src/pkg/testing/testing.go:132
testing.tRunner(0xf764b710, 0xf763b5dc, 0x0)
runtime.goexit /home/rsc/g/go2/src/pkg/runtime/proc.c:149
runtime.goexit()
R=ken2, r
CC=golang-dev
https://golang.org/cl/4000053
2011-02-02 14:44:20 -07:00
|
|
|
|
uintptr pc;
|
2011-07-25 22:52:46 -06:00
|
|
|
|
uintptr rpc[2];
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Ask for two PCs: the one we were asked for
|
|
|
|
|
* and what it called, so that we can see if it
|
|
|
|
|
* "called" sigpanic.
|
|
|
|
|
*/
|
|
|
|
|
retpc = 0;
|
|
|
|
|
if(runtime·callers(1+skip-1, rpc, 2) < 2) {
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
retfile = runtime·emptystring;
|
2010-03-23 18:01:17 -06:00
|
|
|
|
retline = 0;
|
|
|
|
|
retbool = false;
|
2011-07-25 22:52:46 -06:00
|
|
|
|
} else if((f = runtime·findfunc(rpc[1])) == nil) {
|
runtime: more detailed panic traces, line number work
Follow morestack, so that crashes during a stack split
give complete traces. Also mark stack segment boundaries
as an aid to debugging.
Correct various line number bugs with yet another attempt
at interpreting the pc/ln table. This one has a chance at
being correct, because I based it on reading src/cmd/ld/lib.c
instead of on reading the documentation.
Fixes #1138.
Fixes #1430.
Fixes #1461.
throw: runtime: split stack overflow
runtime.throw+0x3e /home/rsc/g/go2/src/pkg/runtime/runtime.c:78
runtime.throw(0x81880af, 0xf75c8b18)
runtime.newstack+0xad /home/rsc/g/go2/src/pkg/runtime/proc.c:728
runtime.newstack()
runtime.morestack+0x4f /home/rsc/g/go2/src/pkg/runtime/386/asm.s:184
runtime.morestack()
----- morestack called from stack: -----
runtime.new+0x1a /home/rsc/g/go2/src/pkg/runtime/malloc.c:288
runtime.new(0x1, 0x0, 0x0)
gongo.makeBoard+0x33 /tmp/Gongo/gongo_robot_test.go:344
gongo.makeBoard(0x809d238, 0x1, 0xf76092c8, 0x1)
----- stack segment boundary -----
gongo.checkEasyScore+0xcc /tmp/Gongo/gongo_robot_test.go:287
gongo.checkEasyScore(0xf764b710, 0x0, 0x809d238, 0x1)
gongo.TestEasyScore+0x8c /tmp/Gongo/gongo_robot_test.go:255
gongo.TestEasyScore(0xf764b710, 0x818a990)
testing.tRunner+0x2f /home/rsc/g/go2/src/pkg/testing/testing.go:132
testing.tRunner(0xf764b710, 0xf763b5dc, 0x0)
runtime.goexit /home/rsc/g/go2/src/pkg/runtime/proc.c:149
runtime.goexit()
R=ken2, r
CC=golang-dev
https://golang.org/cl/4000053
2011-02-02 14:44:20 -07:00
|
|
|
|
retfile = runtime·emptystring;
|
|
|
|
|
retline = 0;
|
|
|
|
|
retbool = true; // have retpc at least
|
2010-03-23 18:01:17 -06:00
|
|
|
|
} else {
|
2011-07-25 22:52:46 -06:00
|
|
|
|
retpc = rpc[1];
|
2010-03-23 18:01:17 -06:00
|
|
|
|
retfile = f->src;
|
runtime: more detailed panic traces, line number work
Follow morestack, so that crashes during a stack split
give complete traces. Also mark stack segment boundaries
as an aid to debugging.
Correct various line number bugs with yet another attempt
at interpreting the pc/ln table. This one has a chance at
being correct, because I based it on reading src/cmd/ld/lib.c
instead of on reading the documentation.
Fixes #1138.
Fixes #1430.
Fixes #1461.
throw: runtime: split stack overflow
runtime.throw+0x3e /home/rsc/g/go2/src/pkg/runtime/runtime.c:78
runtime.throw(0x81880af, 0xf75c8b18)
runtime.newstack+0xad /home/rsc/g/go2/src/pkg/runtime/proc.c:728
runtime.newstack()
runtime.morestack+0x4f /home/rsc/g/go2/src/pkg/runtime/386/asm.s:184
runtime.morestack()
----- morestack called from stack: -----
runtime.new+0x1a /home/rsc/g/go2/src/pkg/runtime/malloc.c:288
runtime.new(0x1, 0x0, 0x0)
gongo.makeBoard+0x33 /tmp/Gongo/gongo_robot_test.go:344
gongo.makeBoard(0x809d238, 0x1, 0xf76092c8, 0x1)
----- stack segment boundary -----
gongo.checkEasyScore+0xcc /tmp/Gongo/gongo_robot_test.go:287
gongo.checkEasyScore(0xf764b710, 0x0, 0x809d238, 0x1)
gongo.TestEasyScore+0x8c /tmp/Gongo/gongo_robot_test.go:255
gongo.TestEasyScore(0xf764b710, 0x818a990)
testing.tRunner+0x2f /home/rsc/g/go2/src/pkg/testing/testing.go:132
testing.tRunner(0xf764b710, 0xf763b5dc, 0x0)
runtime.goexit /home/rsc/g/go2/src/pkg/runtime/proc.c:149
runtime.goexit()
R=ken2, r
CC=golang-dev
https://golang.org/cl/4000053
2011-02-02 14:44:20 -07:00
|
|
|
|
pc = retpc;
|
2011-07-25 22:52:46 -06:00
|
|
|
|
g = runtime·findfunc(rpc[0]);
|
|
|
|
|
if(pc > f->entry && (g == nil || g->entry != (uintptr)runtime·sigpanic))
|
runtime: more detailed panic traces, line number work
Follow morestack, so that crashes during a stack split
give complete traces. Also mark stack segment boundaries
as an aid to debugging.
Correct various line number bugs with yet another attempt
at interpreting the pc/ln table. This one has a chance at
being correct, because I based it on reading src/cmd/ld/lib.c
instead of on reading the documentation.
Fixes #1138.
Fixes #1430.
Fixes #1461.
throw: runtime: split stack overflow
runtime.throw+0x3e /home/rsc/g/go2/src/pkg/runtime/runtime.c:78
runtime.throw(0x81880af, 0xf75c8b18)
runtime.newstack+0xad /home/rsc/g/go2/src/pkg/runtime/proc.c:728
runtime.newstack()
runtime.morestack+0x4f /home/rsc/g/go2/src/pkg/runtime/386/asm.s:184
runtime.morestack()
----- morestack called from stack: -----
runtime.new+0x1a /home/rsc/g/go2/src/pkg/runtime/malloc.c:288
runtime.new(0x1, 0x0, 0x0)
gongo.makeBoard+0x33 /tmp/Gongo/gongo_robot_test.go:344
gongo.makeBoard(0x809d238, 0x1, 0xf76092c8, 0x1)
----- stack segment boundary -----
gongo.checkEasyScore+0xcc /tmp/Gongo/gongo_robot_test.go:287
gongo.checkEasyScore(0xf764b710, 0x0, 0x809d238, 0x1)
gongo.TestEasyScore+0x8c /tmp/Gongo/gongo_robot_test.go:255
gongo.TestEasyScore(0xf764b710, 0x818a990)
testing.tRunner+0x2f /home/rsc/g/go2/src/pkg/testing/testing.go:132
testing.tRunner(0xf764b710, 0xf763b5dc, 0x0)
runtime.goexit /home/rsc/g/go2/src/pkg/runtime/proc.c:149
runtime.goexit()
R=ken2, r
CC=golang-dev
https://golang.org/cl/4000053
2011-02-02 14:44:20 -07:00
|
|
|
|
pc--;
|
|
|
|
|
retline = runtime·funcline(f, pc);
|
2010-03-23 18:01:17 -06:00
|
|
|
|
retbool = true;
|
|
|
|
|
}
|
2011-07-25 22:52:46 -06:00
|
|
|
|
FLUSH(&retpc);
|
2010-03-23 18:01:17 -06:00
|
|
|
|
FLUSH(&retfile);
|
|
|
|
|
FLUSH(&retline);
|
|
|
|
|
FLUSH(&retbool);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2012-09-24 12:58:34 -06:00
|
|
|
|
runtime·Callers(intgo skip, Slice pc, intgo retn)
|
2010-03-23 18:01:17 -06:00
|
|
|
|
{
|
2011-08-22 21:26:39 -06:00
|
|
|
|
// runtime.callers uses pc.array==nil as a signal
|
|
|
|
|
// to print a stack trace. Pick off 0-length pc here
|
|
|
|
|
// so that we don't let a nil pc slice get to it.
|
|
|
|
|
if(pc.len == 0)
|
|
|
|
|
retn = 0;
|
|
|
|
|
else
|
|
|
|
|
retn = runtime·callers(skip, (uintptr*)pc.array, pc.len);
|
2010-03-23 18:01:17 -06:00
|
|
|
|
FLUSH(&retn);
|
|
|
|
|
}
|
2010-03-24 10:40:09 -06:00
|
|
|
|
|
|
|
|
|
void
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
runtime·FuncForPC(uintptr pc, void *retf)
|
2010-03-24 10:40:09 -06:00
|
|
|
|
{
|
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 12:00:19 -06:00
|
|
|
|
retf = runtime·findfunc(pc);
|
2010-03-24 10:40:09 -06:00
|
|
|
|
FLUSH(&retf);
|
|
|
|
|
}
|
2011-07-11 23:23:58 -06:00
|
|
|
|
|
|
|
|
|
uint32
|
|
|
|
|
runtime·fastrand1(void)
|
|
|
|
|
{
|
|
|
|
|
uint32 x;
|
|
|
|
|
|
|
|
|
|
x = m->fastrand;
|
|
|
|
|
x += x;
|
|
|
|
|
if(x & 0x80000000L)
|
|
|
|
|
x ^= 0x88888eefUL;
|
|
|
|
|
m->fastrand = x;
|
|
|
|
|
return x;
|
|
|
|
|
}
|
pprof: add goroutine blocking profiling
The profiler collects goroutine blocking information similar to Google Perf Tools.
You may see an example of the profile (converted to svg) attached to
http://code.google.com/p/go/issues/detail?id=3946
The public API changes are:
+pkg runtime, func BlockProfile([]BlockProfileRecord) (int, bool)
+pkg runtime, func SetBlockProfileRate(int)
+pkg runtime, method (*BlockProfileRecord) Stack() []uintptr
+pkg runtime, type BlockProfileRecord struct
+pkg runtime, type BlockProfileRecord struct, Count int64
+pkg runtime, type BlockProfileRecord struct, Cycles int64
+pkg runtime, type BlockProfileRecord struct, embedded StackRecord
R=rsc, dave, minux.ma, r
CC=gobot, golang-dev, r, remyoudompheng
https://golang.org/cl/6443115
2012-10-06 02:56:04 -06:00
|
|
|
|
|
|
|
|
|
static Lock ticksLock;
|
|
|
|
|
static int64 ticks;
|
|
|
|
|
|
|
|
|
|
int64
|
|
|
|
|
runtime·tickspersecond(void)
|
|
|
|
|
{
|
|
|
|
|
int64 res, t0, t1, c0, c1;
|
|
|
|
|
|
|
|
|
|
res = (int64)runtime·atomicload64((uint64*)&ticks);
|
|
|
|
|
if(res != 0)
|
|
|
|
|
return ticks;
|
|
|
|
|
runtime·lock(&ticksLock);
|
|
|
|
|
res = ticks;
|
|
|
|
|
if(res == 0) {
|
|
|
|
|
t0 = runtime·nanotime();
|
|
|
|
|
c0 = runtime·cputicks();
|
|
|
|
|
runtime·usleep(100*1000);
|
|
|
|
|
t1 = runtime·nanotime();
|
|
|
|
|
c1 = runtime·cputicks();
|
|
|
|
|
if(t1 == t0)
|
|
|
|
|
t1++;
|
|
|
|
|
res = (c1-c0)*1000*1000*1000/(t1-t0);
|
|
|
|
|
if(res == 0)
|
|
|
|
|
res++;
|
|
|
|
|
runtime·atomicstore64((uint64*)&ticks, res);
|
|
|
|
|
}
|
|
|
|
|
runtime·unlock(&ticksLock);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
runtime∕pprof·runtime_cyclesPerSecond(int64 res)
|
|
|
|
|
{
|
|
|
|
|
res = runtime·tickspersecond();
|
|
|
|
|
FLUSH(&res);
|
|
|
|
|
}
|