ObjFW  Diff

Differences From Artifact [f91f71fe9f]:

To Artifact [353b58a3aa]:


11
12
13
14
15
16
17


18
19
20
21
22
23
24
25
26
27
28


29
30
31
32
33
34







35
36
37
38
39
40


41
42
43
44
45
46
47


48
49
50
51
52
53
54


55
56
57
58
59
60
61
62


63
64
65
66
67
68


69
70
71
72
73
74
75
11
12
13
14
15
16
17
18
19
20
21
22
23


24
25
26


27
28
29
30
31
32


33
34
35
36
37
38
39
40
41
42
43


44
45
46
47
48
49
50


51
52
53
54
55
56
57


58
59
60
61
62
63
64
65


66
67
68
69
70
71


72
73
74
75
76
77
78
79
80







+
+




-
-



-
-
+
+




-
-
+
+
+
+
+
+
+




-
-
+
+





-
-
+
+





-
-
+
+






-
-
+
+




-
-
+
+







 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#include <stdlib.h>

#import "OFAllocFailedException.h"
#import "OFString.h"

#import "OFNotImplementedException.h"

@implementation OFAllocFailedException
+ alloc
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- init
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	@try {
		[self doesNotRecognizeSelector: _cmd];
		abort();
	} @catch (id e) {
		[self release];
		@throw e;
	}
}

- (void*)allocMemoryWithSize: (size_t)size
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- (void*)allocMemoryForNItems: (size_t)nitems
                     withSize: (size_t)size
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- (void*)resizeMemory: (void*)ptr
	       toSize: (size_t)size
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- (void*)resizeMemory: (void*)ptr
	     toNItems: (size_t)nitems
	     withSize: (size_t)size
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- (void)freeMemory: (void*)ptr
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- retain
{
	return self;
}

85
86
87
88
89
90
91
92
93
94





95
96
97
98
99
100
101
90
91
92
93
94
95
96



97
98
99
100
101
102
103
104
105
106
107
108







-
-
-
+
+
+
+
+








- (void)release
{
}

- (void)dealloc
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: _cmd];
	[super dealloc];	/* Get rid of a stupid warning */
	[self doesNotRecognizeSelector: _cmd];
	abort();

	/* Get rid of a stupid warning */
	[super dealloc];
}

- (OFString*)description
{
	return @"Allocating an object failed!";
}
@end