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
bf9c778f
Commit
bf9c778f
authored
Oct 13, 2011
by
Dmitriy Vyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: pass FlagNoPointers to runtime.new
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5151043
parent
cd5f144f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
builtin.c.boot
src/cmd/gc/builtin.c.boot
+1
-1
runtime.go
src/cmd/gc/runtime.go
+1
-1
walk.c
src/cmd/gc/walk.c
+1
-1
malloc.goc
src/pkg/runtime/malloc.goc
+4
-2
No files found.
src/cmd/gc/builtin.c.boot
View file @
bf9c778f
char *runtimeimport =
"package runtime\n"
"import runtime \"runtime\"\n"
"func @\"\".new (
? int32
) *any\n"
"func @\"\".new (
typ *uint8
) *any\n"
"func @\"\".panicindex ()\n"
"func @\"\".panicslice ()\n"
"func @\"\".throwreturn ()\n"
...
...
src/cmd/gc/runtime.go
View file @
bf9c778f
...
...
@@ -10,7 +10,7 @@ package PACKAGE
// emitted by compiler, not referred to by go programs
func
new
(
int32
)
*
any
func
new
(
typ
*
byte
)
*
any
func
panicindex
()
func
panicslice
()
func
throwreturn
()
...
...
src/cmd/gc/walk.c
View file @
bf9c778f
...
...
@@ -1686,7 +1686,7 @@ callnew(Type *t)
dowidth
(
t
);
fn
=
syslook
(
"new"
,
1
);
argtype
(
fn
,
t
);
return
mkcall1
(
fn
,
ptrto
(
t
),
nil
,
nodintconst
(
t
->
width
));
return
mkcall1
(
fn
,
ptrto
(
t
),
nil
,
typename
(
t
));
}
static
Node
*
...
...
src/pkg/runtime/malloc.goc
View file @
bf9c778f
...
...
@@ -393,8 +393,10 @@ runtime·mal(uintptr n)
return
runtime
·
mallocgc
(
n
,
0
,
1
,
1
);
}
func
new
(
n
uint32
)
(
ret
*
uint8
)
{
ret
=
runtime
·
mal
(
n
);
func
new
(
typ
*
Type
)
(
ret
*
uint8
)
{
uint32
flag
=
typ
->
kind
&
KindNoPointers
?
FlagNoPointers
:
0
;
ret
=
runtime
·
mallocgc
(
typ
->
size
,
flag
,
1
,
1
);
FLUSH
(&
ret
);
}
void
*
...
...
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