ObjFW  Diff

Differences From Artifact [b5ab4c9ae4]:

To Artifact [ff91f774b0]:


407
408
409
410
411
412
413

414
415
416
417
418

419
420
421
422
423
424

425
426

427
428
429
430
431
432
433
434
435
436
437
438
439
440
441

442
443
444
445
446

447
448
449
450
451
452

453
454

455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
407
408
409
410
411
412
413
414
415




416
417

418

419

420
421

422
423
424
425







426
427
428
429
430
431
432




433
434

435

436

437
438

439
440
441
442







443
444
445
446
447
448
449







+

-
-
-
-
+

-

-

-
+

-
+



-
-
-
-
-
-
-





+

-
-
-
-
+

-

-

-
+

-
+



-
-
-
-
-
-
-







	objc_autoreleasePoolPop(pool);

	return false;
}

- (OFArray*)allKeys
{
	OFMutableArray *ret = [OFMutableArray arrayWithCapacity: [self count]];
	void *pool = objc_autoreleasePoolPush();
	id *keys = [self allocMemoryWithSize: sizeof(id)
				       count: [self count]];
	OFArray *ret;
	OFEnumerator *enumerator;
	OFEnumerator *enumerator = [self keyEnumerator];
	id key;
	size_t i = 0;

	enumerator = [self keyEnumerator];
	while ((key = [enumerator nextObject]) != nil)
		keys[i++] = key;
		[ret addObject: key];

	assert(i == [self count]);
	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	@try {
		ret = [OFArray arrayWithObjects: keys
					  count: [self count]];
	} @finally {
		[self freeMemory: keys];
	}

	return ret;
}

- (OFArray*)allObjects
{
	OFMutableArray *ret = [OFMutableArray arrayWithCapacity: [self count]];
	void *pool = objc_autoreleasePoolPush();
	id *objects = [self allocMemoryWithSize: sizeof(id)
					  count: [self count]];
	OFArray *ret;
	OFEnumerator *enumerator;
	OFEnumerator *enumerator = [self objectEnumerator];
	id object;
	size_t i = 0;

	enumerator = [self objectEnumerator];
	while ((object = [enumerator nextObject]) != nil)
		objects[i++] = object;
		[ret addObject: object];

	assert(i == [self count]);
	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	@try {
		ret = [OFArray arrayWithObjects: objects
					  count: [self count]];
	} @finally {
		[self freeMemory: objects];
	}

	return ret;
}

- (OFEnumerator*)objectEnumerator
{
	[self doesNotRecognizeSelector: _cmd];
	abort();