[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Running app with ARC turned off
From: |
Daniel Santos |
Subject: |
Re: Running app with ARC turned off |
Date: |
Tue, 10 Dec 2024 18:52:46 +0000 |
Daniel Santos
> On 10 Dec 2024, at 14:08, Riccardo Mottola <riccardo.mottola@libero.it> wrote:
>
> Hi,
>
> Daniel Santos wrote:
>> I agree, but my objective is to have ARC disabled to try to reproduce the
>> memory allocations that happen in NeXT (that does not have ARC).
>> Meaning that with ARC disabled I will have to explicitly release objects and
>> therefore catching memory allocation bugs that will happen on the NeXTStep
>> version of the code.
>
> just out of curiosity. NeXTStep or OpenStep? The former is not compatible
> with GNUstep, different API names and many different details, so I wonder how
> you can write the same code.
> OpenStep instead is quite compatible.
> GNUstep itself doesn't need ARC and you can compile without ARC. Easy, just
> use the GCC runtime and so alloc/release/autorelease will do the reference
> counting. I don't know if you can disable ARC with clang
>
NeXTStep 3.3 on black hardware. I am handling the differences with the
preprocessor (basically #ifdef <a defined value>)
Most of the code is the same as I only use NSString, NSDictionary, NSArray (and
the mutable subclasses) etc
Its the imports that are mostly different.
>
> Furthermore for the opposite problem you can enable zombies (NSZombieEnabled
> env variable), as to trace access to deallocated objects. But that is the
> opposite of what you ask: it keeps everything "alive", but useful if you
> debug manual reference counting, since accessing a dead object can be hard to
> trace sometimes.
>
> Riccardo