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
1ea5bc75
Commit
1ea5bc75
authored
Oct 13, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack allocation for the init function
R=r OCL=17063 CL=17063
parent
99c5b2ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
src/cmd/gc/dcl.c
src/cmd/gc/dcl.c
+1
-1
src/cmd/gc/go.h
src/cmd/gc/go.h
+2
-1
src/cmd/gc/go.y
src/cmd/gc/go.y
+7
-2
No files found.
src/cmd/gc/dcl.c
View file @
1ea5bc75
...
...
@@ -987,7 +987,7 @@ fninit(Node *n)
// (2)
maxarg
=
0
;
stksize
=
0
;
stksize
=
initstksize
;
snprint
(
namebuf
,
sizeof
(
namebuf
),
"init_%s_function"
,
filename
);
...
...
src/cmd/gc/go.h
View file @
1ea5bc75
...
...
@@ -451,7 +451,8 @@ EXTERN Node* lastconst;
EXTERN
int32
vargen
;
EXTERN
int32
exportgen
;
EXTERN
int32
maxarg
;
EXTERN
int32
stksize
;
EXTERN
int32
stksize
;
// stack size for current frame
EXTERN
int32
initstksize
;
// stack size for init function
EXTERN
ushort
blockgen
;
// max block number
EXTERN
ushort
block
;
// current block number
...
...
src/cmd/gc/go.y
View file @
1ea5bc75
...
...
@@ -178,7 +178,11 @@ hidden_import_list:
*
declarations
*/
xdcl
:
common_dcl
{
stksize
=
initstksize
;
}
common_dcl
{
$$
=
$
2
;
initstksize
=
stksize
;
}
|
xfndcl
{
$$
=
N
;
...
...
@@ -187,10 +191,11 @@ xdcl:
{
$$
=
N
;
}
|
LEXPORT
{
exportadj
=
1
;
}
common_dcl
|
LEXPORT
{
exportadj
=
1
;
stksize
=
initstksize
;
}
common_dcl
{
$$
=
$
3
;
exportadj
=
0
;
initstksize
=
stksize
;
}
|
LEXPORT
'('
export_list_r
')'
{
...
...
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