src: use LocalVector in more places · nodejs/node@48493e9 · GitHub
Skip to content

Commit 48493e9

Browse files
jasnelladuh95
authored andcommitted
src: use LocalVector in more places
PR-URL: #56457 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 2c6124c commit 48493e9

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

src/crypto/crypto_util.h

Lines changed: 3 additions & 2 deletions

src/env.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,7 @@ bool AsyncHooks::pop_async_context(double async_id) {
176176
}
177177
#endif
178178
native_execution_async_resources_.resize(offset);
179-
if (native_execution_async_resources_.size() <
180-
native_execution_async_resources_.capacity() / 2 &&
181-
native_execution_async_resources_.size() > 16) {
182-
native_execution_async_resources_.shrink_to_fit();
183-
}
179+
native_execution_async_resources_.shrink_to_fit();
184180
}
185181

186182
if (js_execution_async_resources()->Length() > offset) [[unlikely]] {
@@ -1705,6 +1701,7 @@ AsyncHooks::AsyncHooks(Isolate* isolate, const SerializeInfo* info)
17051701
fields_(isolate, kFieldsCount, MAYBE_FIELD_PTR(info, fields)),
17061702
async_id_fields_(
17071703
isolate, kUidFieldsCount, MAYBE_FIELD_PTR(info, async_id_fields)),
1704+
native_execution_async_resources_(isolate),
17081705
info_(info) {
17091706
HandleScope handle_scope(isolate);
17101707
if (info == nullptr) {

src/env.h

Lines changed: 10 additions & 1 deletion

0 commit comments

Comments
 (0)