Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
44b8934d
Commit
44b8934d
authored
Jul 16, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
back out last chan fix
allow print of pointers SVN=127548
parent
90da10d7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
15 deletions
+20
-15
sys.go
src/cmd/gc/sys.go
+1
-1
sysimport.c
src/cmd/gc/sysimport.c
+0
-0
walk.c
src/cmd/gc/walk.c
+15
-8
chan.c
src/runtime/chan.c
+4
-6
No files found.
src/cmd/gc/sys.go
View file @
44b8934d
...
...
@@ -13,7 +13,7 @@ func printbool(bool);
func
printfloat
(
double
);
func
printint
(
int64
);
func
printstring
(
string
);
func
printpointer
(
*
byte
);
func
printpointer
(
*
any
);
func
catstring
(
string
,
string
)
string
;
func
cmpstring
(
string
,
string
)
int32
;
...
...
src/cmd/gc/sysimport.c
View file @
44b8934d
This diff is collapsed.
Click to expand it.
src/cmd/gc/walk.c
View file @
44b8934d
...
...
@@ -1179,6 +1179,8 @@ prcompat(Node *n)
loop:
if
(
l
==
N
)
{
if
(
r
==
N
)
return
nod
(
OBAD
,
N
,
N
);
walktype
(
r
,
Etop
);
return
r
;
}
...
...
@@ -1186,28 +1188,33 @@ loop:
w
=
whatis
(
l
);
switch
(
w
)
{
default:
badtype
(
n
->
op
,
l
->
type
,
T
);
l
=
listnext
(
&
save
);
goto
loop
;
if
(
!
isptr
[
l
->
type
->
etype
])
{
badtype
(
n
->
op
,
l
->
type
,
T
);
l
=
listnext
(
&
save
);
goto
loop
;
}
on
=
syslook
(
"printpointer"
,
1
);
argtype
(
on
,
l
->
type
->
type
);
// any-1
break
;
case
Wlitint
:
case
Wtint
:
name
=
"printint"
;
on
=
syslook
(
"printint"
,
0
)
;
break
;
case
Wlitfloat
:
case
Wtfloat
:
name
=
"printfloat"
;
on
=
syslook
(
"printfloat"
,
0
)
;
break
;
case
Wlitbool
:
case
Wtbool
:
name
=
"printbool"
;
on
=
syslook
(
"printbool"
,
0
)
;
break
;
case
Wlitstr
:
case
Wtstr
:
name
=
"printstring"
;
on
=
syslook
(
"printstring"
,
0
)
;
break
;
}
on
=
syslook
(
name
,
0
);
t
=
*
getinarg
(
on
->
type
);
if
(
t
!=
nil
)
t
=
t
->
type
;
...
...
src/runtime/chan.c
View file @
44b8934d
...
...
@@ -15,8 +15,7 @@ struct Hchan
uint32
dataqsiz
;
// size of the circular q
uint32
qcount
;
// total data in the q
uint32
eo
;
// vararg of element
uint32
po1
;
// vararg of present bool in next structure
uint32
po2
;
// vararg of present bool in same structure
uint32
po
;
// vararg of present bool
Alg
*
elemalg
;
// interface for element type
Link
*
senddataq
;
// pointer for sender
Link
*
recvdataq
;
// pointer for receiver
...
...
@@ -75,8 +74,7 @@ sys·newchan(uint32 elemsize, uint32 elemalg, uint32 hint,
// these calculations are compiler dependent
c
->
eo
=
rnd
(
sizeof
(
c
),
elemsize
);
c
->
po1
=
rnd
(
c
->
eo
+
elemsize
,
8
);
// next structure
c
->
po2
=
rnd
(
c
->
eo
+
elemsize
,
1
);
// same structure
c
->
po
=
rnd
(
c
->
eo
+
elemsize
,
1
);
ret
=
c
;
FLUSH
(
&
ret
);
...
...
@@ -146,7 +144,7 @@ sys·chansend2(Hchan* c, ...)
G
*
gr
;
ae
=
(
byte
*
)
&
c
+
c
->
eo
;
ap
=
(
byte
*
)
&
c
+
c
->
po
1
;
ap
=
(
byte
*
)
&
c
+
c
->
po
;
if
(
debug
)
{
prints
(
"chansend: chan="
);
...
...
@@ -232,7 +230,7 @@ sys·chanrecv2(Hchan* c, ...)
G
*
gs
;
ae
=
(
byte
*
)
&
c
+
c
->
eo
;
ap
=
(
byte
*
)
&
c
+
c
->
po
2
;
ap
=
(
byte
*
)
&
c
+
c
->
po
;
if
(
debug
)
{
prints
(
"chanrecv2: chan="
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment