ObjFW  Diff

Differences From Artifact [ca9a8cdb54]:

To Artifact [0dd3658171]:

  • File src/OFMutableSet.m — part of check-in [e1e7ffa903] at 2011-09-22 23:25:42 on branch trunk — Exceptions are now autoreleased.

    This is safe as an "exception loop" can't happen, since if allocating
    an exception fails, it throws an OFAllocFailedException which is
    preallocated and can always be thrown.

    So, the worst case would be that an autorelease of an exception fails,
    triggering an OFOutOfMemoryException for which there is no memory,
    resulting in an OFAllocFailedException to be thrown. (user: js, size: 3693) [annotate] [blame] [check-ins using]


82
83
84
85
86
87
88
89
90


91
92
93
94
95
96
97
82
83
84
85
86
87
88


89
90
91
92
93
94
95
96
97







-
-
+
+








- (void)release
{
}

- (void)dealloc
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
	[super dealloc];	/* Get rid of a stupid warning */
}
@end

@implementation OFMutableSet
+ (void)initialize
{
108
109
110
111
112
113
114
115
116


117
118
119
120
121
122
123
124
125


126
127
128
129
130
131


132
133
134
135
136
137
138
108
109
110
111
112
113
114


115
116
117
118
119
120
121
122
123


124
125
126
127
128
129


130
131
132
133
134
135
136
137
138







-
-
+
+







-
-
+
+




-
-
+
+







}

- init
{
	if (isa == [OFMutableSet class]) {
		Class c = isa;
		[self release];
		@throw [OFNotImplementedException newWithClass: c
						      selector: _cmd];
		@throw [OFNotImplementedException exceptionWithClass: c
							    selector: _cmd];
	}

	return [super init];
}

- (void)addObject: (id)object
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}

- (void)removeObject: (id)object
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}

- (void)minusSet: (OFSet*)set
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFEnumerator *enumerator = [set objectEnumerator];
	id object;