@@ -26,10 +26,11 @@ #import "OFDictionary.h" #import "OFDataArray.h" #import "OFXMLAttribute.h" #import "OFStream.h" #import "OFFile.h" +#import "OFSystemInfo.h" #import "OFInitializationFailedException.h" #import "OFMalformedXMLException.h" #import "OFUnboundNamespaceException.h" @@ -277,16 +278,17 @@ length: [string UTF8StringLength]]; } - (void)parseStream: (OFStream*)stream { - char *buffer = [self allocMemoryWithSize: of_pagesize]; + size_t pageSize = [OFSystemInfo pageSize]; + char *buffer = [self allocMemoryWithSize: pageSize]; @try { while (![stream isAtEndOfStream]) { size_t length = [stream readIntoBuffer: buffer - length: of_pagesize]; + length: pageSize]; [self parseBuffer: buffer length: length]; } } @finally {