Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
6723dd37
Commit
6723dd37
authored
Mar 29, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Counting heap-allocated vectors.
parent
ef5be943
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
node.cpp
node.cpp
+1
-0
node.hpp
node.hpp
+5
-2
sassc.cpp
sassc.cpp
+1
-1
No files found.
node.cpp
View file @
6723dd37
...
@@ -14,6 +14,7 @@ using std::endl;
...
@@ -14,6 +14,7 @@ using std::endl;
namespace
Sass
{
namespace
Sass
{
size_t
Node
::
fresh
=
0
;
size_t
Node
::
fresh
=
0
;
size_t
Node
::
copied
=
0
;
size_t
Node
::
copied
=
0
;
size_t
Node
::
allocations
=
0
;
Node
Node
::
clone
()
const
Node
Node
::
clone
()
const
{
{
...
...
node.hpp
View file @
6723dd37
...
@@ -75,6 +75,7 @@ namespace Sass {
...
@@ -75,6 +75,7 @@ namespace Sass {
static
size_t
fresh
;
static
size_t
fresh
;
static
size_t
copied
;
static
size_t
copied
;
static
size_t
allocations
;
size_t
line_number
;
size_t
line_number
;
mutable
vector
<
Node
>*
children
;
mutable
vector
<
Node
>*
children
;
...
@@ -128,7 +129,7 @@ namespace Sass {
...
@@ -128,7 +129,7 @@ namespace Sass {
has_backref
(
false
),
has_backref
(
false
),
from_variable
(
false
),
from_variable
(
false
),
eval_me
(
false
)
eval_me
(
false
)
{
children
->
reserve
(
length
);
++
fresh
;
}
{
children
->
reserve
(
length
);
++
fresh
;
++
allocations
;
}
Node
(
size_t
line_number
,
Type
type
,
const
Node
&
n
)
Node
(
size_t
line_number
,
Type
type
,
const
Node
&
n
)
:
line_number
(
line_number
),
:
line_number
(
line_number
),
...
@@ -143,7 +144,7 @@ namespace Sass {
...
@@ -143,7 +144,7 @@ namespace Sass {
has_backref
(
false
),
has_backref
(
false
),
from_variable
(
false
),
from_variable
(
false
),
eval_me
(
false
)
eval_me
(
false
)
{
++
fresh
;
}
{
++
fresh
;
++
allocations
;
}
Node
(
size_t
line_number
,
Type
type
,
const
Node
&
n
,
const
Node
&
m
)
Node
(
size_t
line_number
,
Type
type
,
const
Node
&
n
,
const
Node
&
m
)
:
line_number
(
line_number
),
:
line_number
(
line_number
),
...
@@ -163,6 +164,7 @@ namespace Sass {
...
@@ -163,6 +164,7 @@ namespace Sass {
children
->
push_back
(
n
);
children
->
push_back
(
n
);
children
->
push_back
(
m
);
children
->
push_back
(
m
);
++
fresh
;
++
fresh
;
++
allocations
;
}
}
Node
(
size_t
line_number
,
Type
type
,
Token
&
token
)
Node
(
size_t
line_number
,
Type
type
,
Token
&
token
)
...
@@ -229,6 +231,7 @@ namespace Sass {
...
@@ -229,6 +231,7 @@ namespace Sass {
children
->
push_back
(
Node
(
line_number
,
b
));
children
->
push_back
(
Node
(
line_number
,
b
));
children
->
push_back
(
Node
(
line_number
,
c
));
children
->
push_back
(
Node
(
line_number
,
c
));
++
fresh
;
++
fresh
;
++
allocations
;
}
}
//~Node() { delete children; }
//~Node() { delete children; }
...
...
sassc.cpp
View file @
6723dd37
...
@@ -36,7 +36,7 @@ int main(int argc, char* argv[]) {
...
@@ -36,7 +36,7 @@ int main(int argc, char* argv[]) {
cerr
<<
"Fresh nodes:
\t
"
<<
Node
::
fresh
<<
endl
;
cerr
<<
"Fresh nodes:
\t
"
<<
Node
::
fresh
<<
endl
;
cerr
<<
"Copied nodes:
\t
"
<<
Node
::
copied
<<
endl
;
cerr
<<
"Copied nodes:
\t
"
<<
Node
::
copied
<<
endl
;
cerr
<<
"Allocations:
\t
"
<<
Node
::
allocations
<<
endl
;
cout
<<
output
;
cout
<<
output
;
return
0
;
return
0
;
...
...
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