[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSNotificationCenter's pointer abuse
From: |
David Chisnall |
Subject: |
Re: NSNotificationCenter's pointer abuse |
Date: |
Fri, 10 May 2013 06:56:48 -0400 |
On 9 May 2013, at 00:52, Richard Frith-Macdonald <address@hidden> wrote:
>> If GSIMap wont let us mix different usages in on file
>
> That's a big IF...
The extra conditional code appears to be a work around for GSIMap only being
able to be used once per compilation unit. I don't know if this is actually
the case, but I don't think I've ever seen a file that includes GSIMap.h more
than once per file.
This file also appears to reimplement a lot of things that are implemented
elsewhere, and contains a lot of optimisation. It's not clear how much the
optimisation actually speeds things up (the IMP caching that it does will give
a small speedup, but actually breaks the semantics of the notification center -
see the test case I committed yesterday, which passes on OS X but fails on
GNUstep). It's also not clear how applicable it is to modern systems. The
memory pool, for example, is unlikely to give a noticeable speedup relative to
a modern malloc() and will increase both memory usage and fragmentation.
I've started doing a naïve implementation of NSNotificationCenter, which I'd
like to compare to the existing one for memory usage and performance. If
anyone has any code that makes heavy use of notifications, please let me know.
David
-- Sent from my Apple II