GitShow/facebook/FBRetainCycleDetector
facebook

FBRetainCycleDetector

iOS library to help detecting retain cycles in runtime.

by facebook
Star on GitHubFork

Objective-C++

4.2k stars601 forks51 contributorsActive · 5d agoSince 20160.1.4

Meet the team

See all 51 on GitHub →
megCanicalKb
megCanicalKb13 contributions
tditchek
tditchek6 contributions
twhitt14
twhitt144 contributions
rmaz
rmaz3 contributions
rs17b
rs17b3 contributions
amonshiz
amonshiz2 contributions
arj-fb
arj-fb2 contributions
youngd007
youngd0072 contributions

Languages

View on GitHub →
Objective-C++39.6%
Objective-C35.7%
Swift20.2%
C3.6%
Ruby0.6%
Shell0.4%

Commit activity

Last 12 weeks · 3 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
75
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · Last activity 5d ago
See all on GitHub →
rootkiller6788
Handle unions in struct encoding parsing and harden offset scanOpenPR

What This fixes struct parsing when a struct contains a union, and hardens the struct-offset scan against type encodings cannot handle. 1. Union parsing () - fixes #21 ObjC runtime type encodings represent a union as , or for anonymous unions. The parser did not recognize as a grouping character: it fell through to the literal branch and stopped at the first quoted member name inside the union. For a union with named members such as , the parser previously produced: …treating overlapping union members as sequential struct fields and leaving a malformed encoding. Every subsequent field's offset inside the struct was then wrong, so an object reference stored after the union was located at a garbage index (read of the wrong memory during cycle detection). The fix adds and consumes the whole union as one opaque , keeping the offsets of the types that follow it correct. 2. Layout scan hardening () - related to #126 does not throw on encodings it cannot size (bitfields , C++ types, …): it logs the "unsupported type encoding spec" warning and returns . The code ignored the return value and then computed / from zero or garbage values. The scan now checks the return value and bails out (same intent as the existing branch) instead of producing misaligned references. Tests Added to : literal encoding regression test asserting the exact parsed types. real ivar encoding with a named union. real ivar encoding with an anonymous union. Verified with a standalone C++ build of the parser (ObjC bits mechanically stubbed) that runs the new union cases plus all pre-existing parser cases (primitives, objects, nested structs, bitfields, type paths) with no regressions.

rootkiller6788 · 3d ago
okayz
iOS15 fishhook crashOpenIssue

!image

okayz · 9mo ago
wujingcheng7
FIX: "FBRetainCycleDetector/FBRetainCycleDetector-Swift.h" file not foundOpenPR

FIX: "FBRetainCycleDetector/FBRetainCycleDetector-Swift.h file not found" in Xcode 16

wujingcheng7 · 1y ago

Recent fixes

View closed PRs →
LucasXu0
Use a simpler way to get strong references of block.MergedPR

Inspired by libclosure.

LucasXu0 · 1y ago
Steveramluko
IClosedIssue

I

Steveramluko · 1y ago
amorde
Fix Swift introspection when reading inherited propertiesMergedPR

Fix a bug preventing object references from being detected when the reference is from a property inherited from a parent class. Example: The logic here would receive a value for if the object's did not have a direct child for the associated . Note: I have tested this manually but the existing project is not in a buildable state in order to be able to write a test.

amorde · 2y ago
Structured data for AI agents

Repository: facebook/FBRetainCycleDetector. Description: iOS library to help detecting retain cycles in runtime. Stars: 4232, Forks: 601. Primary language: Objective-C++. Languages: Objective-C++ (39.6%), Objective-C (35.7%), Swift (20.2%), C (3.6%), Ruby (0.6%). Latest release: 0.1.4 (8y ago). Open PRs: 7, open issues: 36. Last activity: 5d ago. Community health: 75%. Top contributors: megCanicalKb, tditchek, twhitt14, rmaz, rs17b, amonshiz, arj-fb, youngd007, chowarfb, ingridwang and others.

·@ofershap

Replace github.com with gitshow.dev