SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
HexFiend/HFSharedMemoryByteSlice.h
1 //
2 // HFSharedMemoryByteSlice.h
3 // HexFiend_2
4 //
5 // Copyright 2008 ridiculous_fish. All rights reserved.
6 //
7
8 #import <HexFiend/HFByteSlice.h>
9
10 /*! @class HFSharedMemoryByteSlice
11 @brief A subclass of HFByteSlice for working with data stored in memory.
12
13 HFSharedMemoryByteSlice is a subclass of HFByteSlice that represents a portion of data from memory, e.g. typed or pasted in by the user. The term "shared" refers to the ability for mutiple HFSharedMemoryByteSlices to reference the same NSData; it does not mean that the data is in shared memory or shared between processes.
14
15 Instances of HFSharedMemoryByteSlice are immutable (like all instances of HFByteSlice). However, to support efficient typing, the backing data is an instance of NSMutableData that may be grown. A referenced range of the NSMutableData will never have its contents changed, but it may be allowed to grow larger, so that the data does not have to be copied merely to append a single byte. This is implemented by overriding the -byteSliceByAppendingSlice: method of HFByteSlice.
16 */
17 @interface HFSharedMemoryByteSlice : HFByteSlice {
18 NSMutableData *data;
19 NSUInteger offset;
20 NSUInteger length;
21 unsigned char inlineTailLength;
22 unsigned char inlineTail[15]; //size chosen to exhaust padding of 32-byte allocator
23 }
24
25 // copies the data
26 - (instancetype)initWithUnsharedData:(NSData *)data;
27
28 // retains, does not copy
29 - (instancetype)initWithData:(NSMutableData *)data;
30 - (instancetype)initWithData:(NSMutableData *)data offset:(NSUInteger)offset length:(NSUInteger)length;
31
32 @end
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.