Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2916365
test_async_gc.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
613 B
Referenced Files
None
Subscribers
None
test_async_gc.js
View Options
async
function
allocateAndWait
()
{
let
data
=
[];
for
(
let
i
=
0
;
i
<
100
;
i
=
i
+
1
)
{
data
.
push
({
value
:
'test '
+
i
});
}
console
.
log
(
'Before await, data length:'
,
data
.
length
);
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
10
));
console
.
log
(
'After await+GC, data length:'
,
data
.
length
);
return
data
.
length
;
}
async
function
main
()
{
for
(
let
i
=
0
;
i
<
3
;
i
=
i
+
1
)
{
console
.
log
(
'Cycle'
,
i
+
1
);
let
result
=
await
allocateAndWait
();
console
.
log
(
'Result:'
,
result
);
}
console
.
log
(
'Done'
);
}
main
().
then
(()
=>
{
console
.
log
(
'=== async done, calling gc ==='
);
});
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Thu, Mar 26, 4:47 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
511859
Default Alt Text
test_async_gc.js (613 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment