diff --git a/Source/BinaryCStream.m b/Source/BinaryCStream.m index 810414bb3..aa7cc5656 100644 --- a/Source/BinaryCStream.m +++ b/Source/BinaryCStream.m @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #ifndef __WIN32__ @@ -491,7 +491,7 @@ static int debug_binary_coder = 0; (*(char**)d)[length] = '\0'; /* Autorelease the newly malloc'ed pointer? Grep for (*objc_free) to see the places the may have to be changed - [MallocAddress autoreleaseMallocAddress: *(char**)d]; */ + [NSData dataWithBytesNoCopy: *(void**)d length: length+1]; */ break; } diff --git a/Source/NSCoder.m b/Source/NSCoder.m index a0672f0df..c101a57ae 100644 --- a/Source/NSCoder.m +++ b/Source/NSCoder.m @@ -24,9 +24,8 @@ #include #include -#include +#include #include -#include @implementation NSCoder @@ -189,7 +188,7 @@ while (count-- > 0) [self decodeValueOfObjCType:type at:where++]; - [[[MallocAddress alloc] initWithAddress: array] autorelease]; + [NSData dataWithBytesNoCopy: array length: count]; return array; } diff --git a/Source/NSConnection.m b/Source/NSConnection.m index b8134fdfa..536d0a73e 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -1224,7 +1224,7 @@ static int messages_received_count; so we don't have a memory leak. Request here that it be autorelease'ed. Also autorelease created objects. */ if (*type == _C_CHARPTR) - [MallocAddress autoreleaseMallocAddress: *(char**)datum]; + [NSData dataWithBytesNoCopy: *(void**)datum length: 1]; else if (*type == _C_ID) [*(id*)datum autorelease]; } @@ -1268,7 +1268,7 @@ static int messages_received_count; so we don't have a memory leak. Request here that it be autorelease'ed. Also autorelease created objects. */ if (*type == _C_CHARPTR) - [MallocAddress autoreleaseMallocAddress: *(char**)datum]; + [NSData dataWithBytesNoCopy: *(void**)datum length: 1]; else if (*type == _C_ID) [*(id*)datum autorelease]; }