ObjFW  Diff

Differences From Artifact [047d11c618]:

To Artifact [8c4896d652]:

  • File src/exceptions/OFOutOfMemoryException.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: 1409) [annotate] [blame] [check-ins using]


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

#include "config.h"

#import "OFOutOfMemoryException.h"
#import "OFString.h"

@implementation OFOutOfMemoryException
+  newWithClass: (Class)class_
  requestedSize: (size_t)size
{
	return [[self alloc] initWithClass: class_
			     requestedSize: size];
}

- initWithClass: (Class)class_
  requestedSize: (size_t)size
{
	self = [super initWithClass: class_];








|
|

|
|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

#include "config.h"

#import "OFOutOfMemoryException.h"
#import "OFString.h"

@implementation OFOutOfMemoryException
+ exceptionWithClass: (Class)class_
       requestedSize: (size_t)size
{
	return [[[self alloc] initWithClass: class_
			      requestedSize: size] autorelease];
}

- initWithClass: (Class)class_
  requestedSize: (size_t)size
{
	self = [super initWithClass: class_];