ObjFW  Diff

Differences From Artifact [238d0749d1]:

To Artifact [dfe3b68b31]:


393
394
395
396
397
398
399
400
401


402
403
404
405
406
407
408
393
394
395
396
397
398
399


400
401
402
403
404
405
406
407
408







-
-
+
+







	} @catch (OFOutOfMemoryException *e) {
		/* We don't really care, as we only made it smaller */
	}
}

- (void)removeLastItem
{
	if (count < 1)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];
	if (count == 0)
		return;

	count--;
	@try {
		data = [self resizeMemory: data
				     size: itemSize
				    count: count];
	} @catch (OFOutOfMemoryException *e) {
659
660
661
662
663
664
665
666
667


668
669
670
671
672
673
674
659
660
661
662
663
664
665


666
667
668
669
670
671
672
673
674







-
-
+
+







	size = newSize;
}

- (void)removeLastItem
{
	size_t newSize, lastPageByte;

	if (count < 1)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];
	if (count == 0)
		return;

	count--;
	lastPageByte = of_pagesize - 1;
	newSize = (count * itemSize + lastPageByte) & ~lastPageByte;

	if (size != newSize) {
		@try {