Commit d4c36835 authored by cristy's avatar cristy

--no commit message

--no commit message
parent f051b7a6
......@@ -2150,7 +2150,7 @@ MagickExport MagickBooleanType IsBlobTemporary(const Image *image)
MagickExport unsigned char *MapBlob(int file,const MapMode mode,
const MagickOffsetType offset,const size_t length)
{
#if defined(MAGICKCORE_HAVE_MMAP_FILEIO)
#if defined(MAGICKCORE_HAVE_MMAP)
int
flags,
protection;
......@@ -4007,7 +4007,7 @@ MagickExport MagickOffsetType TellBlob(const Image *image)
*/
MagickExport MagickBooleanType UnmapBlob(void *map,const size_t length)
{
#if defined(MAGICKCORE_HAVE_MMAP_FILEIO)
#if defined(MAGICKCORE_HAVE_MMAP)
int
status;
......
......@@ -570,9 +570,10 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
/*
Heap memory failed, try anonymous memory mapping.
*/
memory_info->mapped=MagickTrue;
memory_info->blob=MapBlob(-1,IOMode,0,length);
if (memory_info->blob == NULL)
if (memory_info->blob != NULL)
memory_info->mapped=MagickTrue;
else
RelinquishMagickResource(MapResource,length);
}
if (memory_info->blob == NULL)
......@@ -588,16 +589,18 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
{
if ((lseek(file,length-1,SEEK_SET) >= 0) && (write(file,"",1) == 1))
{
memory_info->mapped=MagickTrue;
memory_info->blob=MapBlob(file,IOMode,0,length);
if (memory_info->blob != NULL)
(void) AcquireMagickResource(MapResource,length);
{
memory_info->mapped=MagickTrue;
(void) AcquireMagickResource(MapResource,length);
}
}
(void) close(file);
}
}
if (memory_info->blob == NULL)
return(RelinquishVirtualMemory(memory_info));
memory_info->blob=AcquireMagickMemory(length);
return(memory_info);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment