Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
da225c23
Commit
da225c23
authored
Jan 18, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reflect: fix garbage collection bug in Call.
Fixes #476. R=r CC=golang-dev
https://golang.org/cl/190041
parent
7c1bb003
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
src/pkg/reflect/value.go
src/pkg/reflect/value.go
+9
-5
No files found.
src/pkg/reflect/value.go
View file @
da225c23
...
...
@@ -829,15 +829,19 @@ func (fv *FuncValue) Call(in []Value) []Value {
if
size
<
8
{
size
=
8
}
args
:=
make
([]
byte
,
size
)
ptr
:=
uintptr
(
unsafe
.
Pointer
(
&
args
[
0
]))
// round to pointer size
size
=
(
size
+
ptrSize
-
1
)
&^
(
ptrSize
-
1
)
// Copy into args.
//
// TODO(rsc): revisit when reference counting happens.
// This one may be fine. The values are holding up the
// references for us, so maybe this can be treated
// like any stack-to-stack copy.
// The values are holding up the in references for us,
// but something must be done for the out references.
// For now make everything look like a pointer by pretending
// to allocate a []*int.
args
:=
make
([]
*
int
,
size
/
ptrSize
)
ptr
:=
uintptr
(
unsafe
.
Pointer
(
&
args
[
0
]))
off
:=
uintptr
(
0
)
delta
:=
0
if
v
:=
fv
.
first
;
v
!=
nil
{
...
...
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