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
46137f22
Commit
46137f22
authored
May 25, 2013
by
Dmitriy Vyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: update comment on stack allocator
R=golang-dev, r CC=golang-dev
https://golang.org/cl/9665046
parent
a2ec8abd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
stack.c
src/pkg/runtime/stack.c
+4
-7
No files found.
src/pkg/runtime/stack.c
View file @
46137f22
...
...
@@ -81,13 +81,10 @@ runtime·stackalloc(uint32 n)
if
(
g
!=
m
->
g0
)
runtime
·
throw
(
"stackalloc not on scheduler stack"
);
// Stack allocator uses malloc/free most of the time,
// but if we're in the middle of malloc and need stack,
// we have to do something else to avoid deadlock.
// In that case, we fall back on a fixed-size free-list
// allocator, assuming that inside malloc all the stack
// frames are small, so that all the stack allocations
// will be a single size, the minimum (right now, 5k).
// Stacks are usually allocated with a fixed-size free-list allocator,
// but if we need a stack of non-standard size, we fall back on malloc
// (assuming that inside malloc and GC all the stack frames are small,
// so that we do not deadlock).
if
(
n
==
FixedStack
||
m
->
mallocing
||
m
->
gcing
)
{
if
(
n
!=
FixedStack
)
{
runtime
·
printf
(
"stackalloc: in malloc, size=%d want %d
\n
"
,
FixedStack
,
n
);
...
...
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