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
104d269a
Commit
104d269a
authored
Apr 17, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keeping a registry of allocations.
parent
e73dc124
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
node.cpp
node.cpp
+2
-1
node.hpp
node.hpp
+4
-2
No files found.
node.cpp
View file @
104d269a
...
...
@@ -15,7 +15,7 @@ using std::endl;
namespace
Sass
{
size_t
Node
::
allocations
=
0
;
Node
Node
::
clone
()
const
Node
Node
::
clone
(
vector
<
vector
<
Node
>*>&
registry
)
const
{
Node
n
(
*
this
);
if
(
has_children
)
{
...
...
@@ -25,6 +25,7 @@ namespace Sass {
for
(
int
i
=
0
;
i
<
size
();
++
i
)
{
n
<<
at
(
i
).
clone
();
}
registry
.
push_back
(
n
.
content
.
children
);
}
return
n
;
}
...
...
node.hpp
View file @
104d269a
...
...
@@ -199,12 +199,13 @@ namespace Sass {
Node
(
Type
t
)
// flags or booleans
{
clear
();
type
=
t
;
}
Node
(
Type
t
,
unsigned
int
ln
,
size_t
s
=
0
)
// nodes with children
Node
(
Type
t
,
vector
<
vector
<
Node
>*>&
registry
,
unsigned
int
ln
,
size_t
s
=
0
)
// nodes with children
{
clear
();
type
=
t
;
line_number
=
ln
;
content
.
children
=
new
vector
<
Node
>
;
registry
.
push_back
(
content
.
children
);
content
.
children
->
reserve
(
s
);
has_children
=
true
;
++
allocations
;
...
...
@@ -236,12 +237,13 @@ namespace Sass {
content
.
dimension
.
unit
=
tok
.
begin
;
}
Node
(
unsigned
int
ln
,
double
r
,
double
g
,
double
b
,
double
a
=
1.0
)
// colors
Node
(
vector
<
vector
<
Node
>*>&
registry
,
unsigned
int
ln
,
double
r
,
double
g
,
double
b
,
double
a
=
1.0
)
// colors
{
clear
();
type
=
numeric_color
;
line_number
=
ln
;
content
.
children
=
new
vector
<
Node
>
;
registry
.
push_back
(
content
.
children
);
content
.
children
->
reserve
(
4
);
content
.
children
->
push_back
(
Node
(
ln
,
r
));
content
.
children
->
push_back
(
Node
(
ln
,
g
));
...
...
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