On Thu, Mar 12, 2009 at 3:17 PM, Peter Ammon <pam...@apple.com> wrote:
>
> Hi John,
>
> Instead of storing each string individually into the heap, try batching up,
> say, 1k or so into a stack allocated buffer.  Then use
> objc_memmove_collectable() to move them in bulk into the heap at the point
> your stack allocated buffer gets full, or your scan finishes.
>

I actually did give this a shot, or something close to it.  I tried
using just the stack (swapping NSAllocateCollectable() with alloca()),
but no joy- exactly the same times came out.  Good call though.

The problem is objc_assign_strongCast(), which surprisingly doesn't
seem to have a 'fast path' escape if it detects a write to an address
on the stack.  I would have figured that at least the main threads
stack bounds would have been accounted for (I would be surprised if
this wasn't immutable once the linker handed off execution to the
program), as this really amounts to nothing more than a >= <= check,
but nope.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to