Avoid reallocating objects post-hoc based on the initializer used.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40038 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Niels Grewe 2016-07-27 07:02:42 +00:00
parent 1b82abd967
commit 2e18a14485
3 changed files with 47 additions and 45 deletions

View file

@ -102,11 +102,12 @@ DEFINE_BLOCK_TYPE(GSDataDeallocatorBlock, void, void*, NSUInteger);
* <override-subclass/>
* Initialize the receiver to hold memory pointed to by bytes without copying.
* When the receiver is deallocated, the memory will be freed using the user
* supplied deallocator block.
* supplied deallocBlock. Note that passing a block that (either directly or
* indirectly) holds a strong reference the receiver will cause a retain cycle.
*/
- (instancetype) initWithBytesNoCopy: (void*)bytes
length: (NSUInteger)length
deallocator: (GSDataDeallocatorBlock)deallocator;
deallocator: (GSDataDeallocatorBlock)deallocBlock;
#endif
- (id) initWithBytes: (const void*)aBuffer
length: (NSUInteger)bufferSize;