Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: src/factory.h

Issue 2041963003: [elements] Precisely estimate elements size for large-object limits (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add missing method on string wrapper Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/elements.cc ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.h
diff --git a/src/factory.h b/src/factory.h
index e8d4a3a5d4ef307d9f3ef5bf065e76895c23c585..d059b108884af761357de7d2b642db1d08010b3c 100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -31,6 +31,14 @@ class V8_EXPORT_PRIVATE Factory final {
// Allocates a fixed array initialized with undefined values.
Handle<FixedArray> NewFixedArray(int size,
PretenureFlag pretenure = NOT_TENURED);
+ // Tries allocating a fixed array initialized with undefined values.
+ // In case of an allocation failure (OOM) an empty handle is returned.
+ // The caller has to manually signal an
+ // v8::internal::Heap::FatalProcessOutOfMemory typically by calling
+ // NewFixedArray as a fallback.
+ MUST_USE_RESULT
+ MaybeHandle<FixedArray> TryNewFixedArray(
+ int size, PretenureFlag pretenure = NOT_TENURED);
// Allocate a new fixed array with non-existing entries (the hole).
Handle<FixedArray> NewFixedArrayWithHoles(
« no previous file with comments | « src/elements.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698