Skip to content

perf(mutex): Optimize CriticalSectionClass by inlining CRITICAL_SECTION storage#498

Merged
x64-dev merged 1 commit intomainfrom
seer/perf/inline-critical-section
May 7, 2026
Merged

perf(mutex): Optimize CriticalSectionClass by inlining CRITICAL_SECTION storage#498
x64-dev merged 1 commit intomainfrom
seer/perf/inline-critical-section

Conversation

@seer-by-sentry
Copy link
Copy Markdown

@seer-by-sentry seer-by-sentry Bot commented May 7, 2026

Fixes CLIENT-1ES. The issue was that: Heap corruption from _aligned_free on non-_aligned_malloc memory for CriticalSectionClass instances, causing RtlLeaveCriticalSection crash.

  • Changed CriticalSectionClass to use inline storage for CRITICAL_SECTION objects.
  • Eliminated heap allocation and deallocation for critical sections, improving performance and reducing memory overhead.
  • Ensured proper alignment for the inline CRITICAL_SECTION storage.

This fix was generated by Seer in Sentry, triggered by x64-dev. 👁️ Run ID: 13885643

Not quite right? Click here to continue debugging with Seer.

@seer-by-sentry seer-by-sentry Bot requested a review from x64-dev May 7, 2026 21:30
@x64-dev x64-dev marked this pull request as ready for review May 7, 2026 21:31
@x64-dev x64-dev merged commit e3cb09e into main May 7, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant