[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: Non-fragile ivars
From: |
Saso Kiselkov |
Subject: |
Re: RFC: Non-fragile ivars |
Date: |
Tue, 03 Jun 2008 20:40:32 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080502) |
It's a shame they removed, because it allows you to do some very cool
stuff (though I agree that you can shoot yourself in the foot pretty
badly) - I used it once to implement an object allocation monitor by
transparently masking +alloc.
--
Saso
hns@computer.org wrote:
> On 3 Jun., 15:47, Michael Ash <m...@mikeash.com> wrote:
>
>> Saso Kiselkov <skisel...@gmail.com> wrote:
>>
>>> It would be great to also add this algorithm into +poseAsClass: and
>>> possibly category handling, since that would allow to have posing
>>> classes and categories define their own ivars.
>>>
>> You have to be really careful with this because you can't have any
>> existing instances of the class in question when you make such a
>> modification. If there are already objects floating around then a lot of
>> bad things happen. This will work fine if you load categories at launch or
>> explicitly pose before creating objects, but normally these two operations
>> have been safe to perform at will. I assume that this is at least part of
>> the reason why Apple doesn't allow declaring ivars in categories even with
>> their new shiny runtime.
>>
>>
>
> Ah, this may be the reason why class posing is no longer available in
> Obj-C 2.0 and the new Apple Runtime (but for 64 bit mode only!)...
>
> http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/DeprecationAppendix/AppendixADeprecatedAPI.html
>
> "Posing is deprecated in Mac OS X v10.5. The poseAsClass: method is
> not available in 64-bit applications on Mac OS X v10.5."
>
> http://developer.apple.com/releasenotes/Cocoa/RN-ObjectiveC/index.html#//apple_ref/doc/uid/TP40004309-DontLinkElementID_10
>
> "All instance variables in 64-bit Objective-C are non-fragile."
>
> But: where do we really need class posing (although I like the
> concept)?
>
> -- hns
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
>
- Re: RFC: Non-fragile ivars, Richard Frith-Macdonald, 2008/06/01
- Re: RFC: Non-fragile ivars, Saso Kiselkov, 2008/06/01
- Re: RFC: Non-fragile ivars, Fred Kiefer, 2008/06/03
- Re: RFC: Non-fragile ivars, Saso Kiselkov, 2008/06/03
- Re: RFC: Non-fragile ivars, David Chisnall, 2008/06/03
- Re: RFC: Non-fragile ivars, Saso Kiselkov, 2008/06/03
- Message not available
- Re: RFC: Non-fragile ivars, Michael Ash, 2008/06/04
- Re: RFC: Non-fragile ivars, address@hidden, 2008/06/03
- Re: RFC: Non-fragile ivars,
Saso Kiselkov <=
- Re: RFC: Non-fragile ivars, Graham J Lee, 2008/06/03
- Re: RFC: Non-fragile ivars, Michael Ash, 2008/06/04
- Re: RFC: Non-fragile ivars, David Chisnall, 2008/06/05