Don't use MallocAddress

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2992 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1998-09-30 08:24:05 +00:00
parent 8c4e627170
commit f90baf26c9

View file

@ -59,7 +59,6 @@
#include <config.h> #include <config.h>
#include <objc/objc-api.h> #include <objc/objc-api.h>
#include <gnustep/base/preface.h> #include <gnustep/base/preface.h>
#include <gnustep/base/MallocAddress.h>
#include <Foundation/NSByteOrder.h> #include <Foundation/NSByteOrder.h>
#include <Foundation/NSCoder.h> #include <Foundation/NSCoder.h>
#include <Foundation/NSData.h> #include <Foundation/NSData.h>
@ -570,8 +569,10 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len)
return; return;
} }
else { else {
OBJC_MALLOC (*(char**)data, char, length+1); unsigned len = (length+1)*sizeof(char);
adr = [MallocAddress autoreleaseMallocAddress:*(void**)data];
*(char**)data = (char*)objc_malloc(len);
adr = [NSData dataWithBytesNoCopy: *(void**)data length: len];
} }
[self deserializeBytes:*(char**)data length:length atCursor:cursor]; [self deserializeBytes:*(char**)data length:length atCursor:cursor];
@ -618,10 +619,11 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len)
break; break;
} }
case _C_PTR: { case _C_PTR: {
unsigned len = objc_sizeof_type(++type);
id adr; id adr;
OBJC_MALLOC (*(char**)data, char, objc_sizeof_type(++type)); *(char**)data = (char*)objc_malloc(len);
adr = [MallocAddress autoreleaseMallocAddress:*(void**)data]; adr = [NSData dataWithBytesNoCopy: *(void**)data length: len];
[self deserializeDataAt:*(char**)data [self deserializeDataAt:*(char**)data
ofObjCType:type ofObjCType:type