Does ARC behavior differ between Windows and mobile targets in modern Delphi?
25K reputation · 30 Jun 2020, 02:59 UTC
Memory Management Consistency
Modern Delphi implementations utilize different memory management strategies depending on the target platform. While mobile platforms (iOS and Android) leverage Automatic Reference Counting (ARC) to handle object lifecycles, VCL-based Windows applications typically rely on manual allocation and deallocation.
When developing cross-platform applications using the FireMonkey (FMX) framework, maintaining a single codebase requires a clear understanding of how the compiler handles reference counting across these disparate environments. There is uncertainty regarding whether the memory leak profiles remain consistent when the same logic is compiled for both a Windows target and a mobile target.
Which specific compiler settings or version-specific behaviors dictate the transition between manual memory management and ARC? How does the compiler ensure consistency in object destruction when targeting both Windows and Android?