From 120e9924c177c7a8fde06b9c5eca98e4e2a19180 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 20 May 2020 00:24:26 +0200 Subject: Cleanup: remove legacy mmap memory allocation for 32 bit This helped to go beyond the 4GB limit, but is no longer relevant for 64 bit. --- source/blender/imbuf/intern/allocimbuf.c | 2 +- source/blender/imbuf/intern/cache.c | 4 ++-- source/blender/imbuf/intern/divers.c | 2 +- source/blender/imbuf/intern/openexr/openexr_api.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 6c17254e697..4b3858e6d5a 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -380,7 +380,7 @@ void *imb_alloc_pixels( } size_t size = (size_t)x * (size_t)y * (size_t)channels * typesize; - return MEM_mapallocN(size, name); + return MEM_callocN(size, name); } bool imb_addrectfloatImBuf(ImBuf *ibuf) diff --git a/source/blender/imbuf/intern/cache.c b/source/blender/imbuf/intern/cache.c index 176b41d2706..23ce9bd7818 100644 --- a/source/blender/imbuf/intern/cache.c +++ b/source/blender/imbuf/intern/cache.c @@ -427,8 +427,8 @@ void IMB_tiles_to_rect(ImBuf *ibuf) /* don't call imb_addrectImBuf, it frees all mipmaps */ if (!mipbuf->rect) { - if ((mipbuf->rect = MEM_mapallocN(ibuf->x * ibuf->y * sizeof(unsigned int), - "imb_addrectImBuf"))) { + if ((mipbuf->rect = MEM_callocN(ibuf->x * ibuf->y * sizeof(unsigned int), + "imb_addrectImBuf"))) { mipbuf->mall |= IB_rect; mipbuf->flags |= IB_rect; } diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index e068a84aab0..bcc8488089d 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -788,7 +788,7 @@ void IMB_float_from_rect(ImBuf *ibuf) size = size * 4 * sizeof(float); ibuf->channels = 4; - rect_float = MEM_mapallocN(size, "IMB_float_from_rect"); + rect_float = MEM_callocN(size, "IMB_float_from_rect"); if (rect_float == NULL) { return; diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 62cc2e605e5..882808cbc14 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1598,8 +1598,8 @@ static ExrHandle *imb_exr_begin_read_mem(IStream &file_stream, for (lay = (ExrLayer *)data->layers.first; lay; lay = lay->next) { for (pass = (ExrPass *)lay->passes.first; pass; pass = pass->next) { if (pass->totchan) { - pass->rect = (float *)MEM_mapallocN(width * height * pass->totchan * sizeof(float), - "pass rect"); + pass->rect = (float *)MEM_callocN(width * height * pass->totchan * sizeof(float), + "pass rect"); if (pass->totchan == 1) { echan = pass->chan[0]; echan->rect = pass->rect; -- cgit v1.2.3