FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node/src/cppgc_helpers.cc at main · JonathanLopes404/node · GitHub
JonathanLopes404
/
node
Public
forked from
nodejs/node
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
node
/
src
/
cppgc_helpers.cc
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (36 loc) · 1.02 KB
Breadcrumbs
node
/
src
/
cppgc_helpers.cc
Copy path
File metadata and controls
40 lines (36 loc) · 1.02 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
include
"
cppgc_helpers.h
"
#
include
"
env-inl.h
"
namespace
node
{
void
CppgcWrapperList::Cleanup
() {
for
(
auto
node : *
this
) {
CppgcMixin* ptr = node->
persistent
.
Get
();
if
(ptr !=
nullptr
) {
ptr->
Finalize
();
}
}
}
void
CppgcWrapperList::MemoryInfo
(MemoryTracker* tracker)
const
{
for
(
auto
node : *
this
) {
CppgcMixin* ptr = node->
persistent
.
Get
();
if
(ptr !=
nullptr
) {
//
TODO(addaleax): Add weak edges instead of no edges once
//
https://github.com/v8/v8/commit/e37cadf1143a8c5bbe44c0408186b5a26cc23863
//
is available for us
tracker->
Track
(ptr, MemoryTracker::
kWeakEdge
);
}
}
}
void
CppgcWrapperList::PurgeEmpty
() {
for
(
auto
weak_it =
begin
(); weak_it !=
end
();) {
CppgcWrapperListNode* node = *weak_it;
auto
next_it = ++weak_it;
//
The underlying cppgc wrapper has already been garbage collected.
//
Remove it from the list.
if
(!node->
persistent
) {
node->
persistent
.
Clear
();
delete
node;
}
weak_it = next_it;
}
}
}
//
namespace node
Back
|
FazBrowse Home
|
New Git URL