Repository navigation
Enable CHECK_REF_COUNTED_LIFECYCLE - #121
Conversation
|
/build-preview |
|
🔄 Preview build started Release tag: |
WalkthroughTwo WebKit files remove Bun-specific preprocessor conditionals. The WasmMemory.h file unconditionally includes assertion logic in checkLifetime(), while RefCountDebugger.h simplifies CHECK_REF_COUNTED_LIFECYCLE to depend solely on assertion and security settings, removing the prior Bun-specific branch. Changes
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-10-01T01:58:56.267ZApplied to files:
📚 Learning: 2025-10-01T01:58:28.399ZApplied to files:
🔇 Additional comments (1)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
|
This may have been caused by a newer build being triggered for the same PR. |
|
/build-preview |
|
🔄 Preview build started Release tag: |
|
✅ Preview build completed Release: autobuild-preview-pr-121-f24072bb |
### What does this PR do? Enables `CHECK_REF_COUNTED_LIFECYCLE` in WebKit ( oven-sh/WebKit#121 ) See also WebKit/WebKit@a978fae #### `CHECK_REF_COUNTED_LIFECYCLE`? A compile-time macro that enables lifecycle validation for reference-counted objects in debug builds. **Definition** ```cpp #if ASSERT_ENABLED || ENABLE(SECURITY_ASSERTIONS) #define CHECK_REF_COUNTED_LIFECYCLE 1 #else #define CHECK_REF_COUNTED_LIFECYCLE 0 #endif ``` **Purpose** Detects three categories of bugs: 1. Missing adoption - Objects stored in RefPtr without using adoptRef() 2. Ref during destruction - ref() called while destructor is running (causes dangling pointers) 3. Thread safety violations - Unsafe ref/deref across threads **Implementation** When enabled, RefCountDebugger adds two tracking flags: - m_deletionHasBegun - Set when destructor starts - m_adoptionIsRequired - Cleared when adoptRef() is called These flags are checked on every ref()/deref() call, with assertions failing on violations. **Motivation** Refactored debug code into a separate RefCountDebugger class to: - Improve readability of core refcount logic - Eliminate duplicate code across RefCounted, ThreadSafeRefCounted, etc. - Simplify adding new refcount classes **Overhead** Zero in release builds - the flags and checks are compiled out entirely. ### How did you verify your code works? --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
### What does this PR do? Enables `CHECK_REF_COUNTED_LIFECYCLE` in WebKit ( oven-sh/WebKit#121 ) See also WebKit/WebKit@a978fae #### `CHECK_REF_COUNTED_LIFECYCLE`? A compile-time macro that enables lifecycle validation for reference-counted objects in debug builds. **Definition** ```cpp #if ASSERT_ENABLED || ENABLE(SECURITY_ASSERTIONS) #define CHECK_REF_COUNTED_LIFECYCLE 1 #else #define CHECK_REF_COUNTED_LIFECYCLE 0 #endif ``` **Purpose** Detects three categories of bugs: 1. Missing adoption - Objects stored in RefPtr without using adoptRef() 2. Ref during destruction - ref() called while destructor is running (causes dangling pointers) 3. Thread safety violations - Unsafe ref/deref across threads **Implementation** When enabled, RefCountDebugger adds two tracking flags: - m_deletionHasBegun - Set when destructor starts - m_adoptionIsRequired - Cleared when adoptRef() is called These flags are checked on every ref()/deref() call, with assertions failing on violations. **Motivation** Refactored debug code into a separate RefCountDebugger class to: - Improve readability of core refcount logic - Eliminate duplicate code across RefCounted, ThreadSafeRefCounted, etc. - Simplify adding new refcount classes **Overhead** Zero in release builds - the flags and checks are compiled out entirely. ### How did you verify your code works? --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
We disable
CHECK_REF_COUNTED_LIFECYCLEtemporary to build latest WebKit.But we can enable it now.