我想分配内存 NSImage * originalLocationImage;我想为700 MB分配内存到800 MB图像大小
NSURL * fileURL = [NSURL fileURLWithPath:originalLocation]; // originalLocation是我磁盘中的文件路径
originalLocationImage = [[NSImage alloc] initByReferencingURL:fileURL];
NSBitmapImageRep *sourceRep = [[NSBitmapImageRep alloc]initWithData:[SourceImage TIFFRepresentation]] //this line fails to allocate memory
,也未能为大尺寸图像/
,并引发错误
malloc: *** mmap(size=268435456) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
的小图像能够正常工作。
任何帮助?
之后,我想创建该图像的预览,那么最好的方法是做什么。我尝试了很多东西,但现在找不到任何方法。 – ashish 2009-06-03 09:27:34