ObjFW  Diff

Differences From Artifact [cbcf953b58]:

To Artifact [d2de206fb4]:

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


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
#import "OFSeekableStream.h"

#import "OFNotImplementedException.h"

@implementation OFSeekableStream
- (void)_seekToOffset: (off_t)offset
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- (off_t)_seekForwardWithOffset: (off_t)offset
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- (off_t)_seekToOffsetRelativeToEnd: (off_t)offset
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- (void)seekToOffset: (off_t)offset
{
	[self _seekToOffset: offset];

	[self freeMemory: cache];







|
|




|
|




|
|







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
#import "OFSeekableStream.h"

#import "OFNotImplementedException.h"

@implementation OFSeekableStream
- (void)_seekToOffset: (off_t)offset
{
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}

- (off_t)_seekForwardWithOffset: (off_t)offset
{
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}

- (off_t)_seekToOffsetRelativeToEnd: (off_t)offset
{
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
}

- (void)seekToOffset: (off_t)offset
{
	[self _seekToOffset: offset];

	[self freeMemory: cache];