From f01b47257a75d0e43ee4aed76b6de421ce692604 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Wed, 6 Nov 2024 23:10:36 -0800 Subject: [PATCH] let PointerValue::invalidate() be noexcept (#47354) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47354 `PointerValue::invalidate()` is called from `Pointer` destructor, which is implicitly `noexcept`, and from `Pointer` move-assignment operator, which is now `noexcept`. Reviewed By: neildhar Differential Revision: D65271399 fbshipit-source-id: 26fd9707e4389da78537d0d607adaef0c68690ca --- packages/react-native/ReactCommon/jsc/JSCRuntime.cpp | 12 ++++++------ packages/react-native/ReactCommon/jsi/jsi/jsi.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp index 2216126af41..6ea718b1e47 100644 --- a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp +++ b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp @@ -94,7 +94,7 @@ class JSCRuntime : public jsi::Runtime { const std::atomic& ctxInvalid, JSValueRef sym); #endif - void invalidate() override; + void invalidate() noexcept override; JSGlobalContextRef ctx_; const std::atomic& ctxInvalid_; @@ -114,7 +114,7 @@ class JSCRuntime : public jsi::Runtime { #else JSCStringValue(JSStringRef str); #endif - void invalidate() override; + void invalidate() noexcept override; JSStringRef str_; #ifndef NDEBUG @@ -135,7 +135,7 @@ class JSCRuntime : public jsi::Runtime { #endif ); - void invalidate() override; + void invalidate() noexcept override; JSGlobalContextRef ctx_; const std::atomic& ctxInvalid_; @@ -506,7 +506,7 @@ JSCRuntime::JSCSymbolValue::JSCSymbolValue( #endif } -void JSCRuntime::JSCSymbolValue::invalidate() { +void JSCRuntime::JSCSymbolValue::invalidate() noexcept { #ifndef NDEBUG counter_ -= 1; #endif @@ -531,7 +531,7 @@ JSCRuntime::JSCStringValue::JSCStringValue(JSStringRef str) : str_(JSStringRetain(str)) {} #endif -void JSCRuntime::JSCStringValue::invalidate() { +void JSCRuntime::JSCStringValue::invalidate() noexcept { // These JSC{String,Object}Value objects are implicitly owned by the // {String,Object} objects, thus when a String/Object is destructed // the JSC{String,Object}Value should be released. @@ -566,7 +566,7 @@ JSCRuntime::JSCObjectValue::JSCObjectValue( #endif } -void JSCRuntime::JSCObjectValue::invalidate() { +void JSCRuntime::JSCObjectValue::invalidate() noexcept { #ifndef NDEBUG counter_ -= 1; #endif diff --git a/packages/react-native/ReactCommon/jsi/jsi/jsi.h b/packages/react-native/ReactCommon/jsi/jsi/jsi.h index 07e3722cb0e..a826923a640 100644 --- a/packages/react-native/ReactCommon/jsi/jsi/jsi.h +++ b/packages/react-native/ReactCommon/jsi/jsi/jsi.h @@ -288,7 +288,7 @@ class JSI_EXPORT Runtime { // rvalue arguments/methods would also reduce the number of clones. struct PointerValue { - virtual void invalidate() = 0; + virtual void invalidate() noexcept = 0; protected: virtual ~PointerValue() = default;