Richard Frith-Macdonald wrote:
RELEASE was introduced to completely remove the call to -release in the
case when gc was enabled. Apple have now effectively done the same
thing by modifying the compiler to remove the call itsself... we went
for a more portable solution, but as they control the compiler version
being used, Apples decision makes a lot of sense.
TEST_RELEASE was added to optimise the common case of sending -release
to nil when gc was not enabled ... the 'if (object)' test being much
more efficient than a method call.
Neither optimisation is really important IMO, now that processors are
*much* faster than they were when these macros were introduced. The
overheads of calling -release are generally a much smaller proportion of
the overall running time of a program than they used to be.
I think the ASSIGN, ASSIGNCOPY, and DESTROY macros are still worthwhile
having as conveniences (and because they tend to prevent some common
coding errors).
I fully agree with that statement. RELEASE and RETAIN really don't have
much worth in themselves, but ASSIGN ASSIGNCOPY and even DESTROY do. My
view is that we just stick with all of them, but don't enforce them as
we used to. The idea behind being that when people use RETAIN and
RELEASE they will also use ASSIGN and that is worth it.
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep