ObjFW  Diff

Differences From Artifact [d5e3e3b36f]:

  • File src/OFObject.m — part of check-in [f5927f8a84] at 2012-07-14 20:00:11 on branch trunk — New autorelease pools.

    This uses the runtime's autorelease pools and implements autorelease
    pools in the ObjFW runtime. It therefore uses ObjFW's autorelease pools
    when using the ObjFW runtime and Apple's autorelease pools when using
    the Apple runtime.

    These new pools should be ARC-compatible now and finally, it should be
    possible to mix OFAutoreleasePools and NSAutoreleasePools again, even
    @autoreleasepool is allowed in the mix now. This also means the old
    bridge to NSAutoreleasePool should not be required anymore, as both use
    the runtime's autorelease pools now.

    As a bonus, it's significantly faster to use the ObjFW runtime with
    ObjFW's autorelease pools than to use Apple's runtime with Apple's
    autorelease pools, as a quick benchmark using OFXMLParser on large files
    showed. (Note: This is not only due to the different autorelease pools,
    but also due to the fact that even with the same autorelease pools it is
    faster using the ObjFW runtime, as can be seen in versions prior to this
    commit.) (user: js, size: 19973) [annotate] [blame] [check-ins using]

To Artifact [d6164e1afa]:


615
616
617
618
619
620
621


622
623
624
625
626
627
628
	preMem->owner = self;
	preMem->prev = PRE_IVAR->lastMem;
	preMem->next = NULL;

	if (PRE_IVAR->lastMem != NULL)
		PRE_IVAR->lastMem->next = preMem;



	PRE_IVAR->lastMem = preMem;

	return (char*)pointer + PRE_MEM_ALIGN;
}

- (void*)allocMemoryWithSize: (size_t)size
		       count: (size_t)count







>
>







615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
	preMem->owner = self;
	preMem->prev = PRE_IVAR->lastMem;
	preMem->next = NULL;

	if (PRE_IVAR->lastMem != NULL)
		PRE_IVAR->lastMem->next = preMem;

	if (PRE_IVAR->firstMem == NULL)
		PRE_IVAR->firstMem = preMem;
	PRE_IVAR->lastMem = preMem;

	return (char*)pointer + PRE_MEM_ALIGN;
}

- (void*)allocMemoryWithSize: (size_t)size
		       count: (size_t)count