From fd1a99afed2f96a667e57ec3358e9b4e74de1bc0 Mon Sep 17 00:00:00 2001 From: Austin Han Date: Mon, 25 Sep 2017 13:25:38 -0400 Subject: [PATCH] fixed allocator --- pkg/torch/lib/TH/THAllocator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/torch/lib/TH/THAllocator.c b/pkg/torch/lib/TH/THAllocator.c index e69b3cc9c..c975b09b8 100644 --- a/pkg/torch/lib/TH/THAllocator.c +++ b/pkg/torch/lib/TH/THAllocator.c @@ -105,9 +105,9 @@ void THMapAllocatorContext_free(THMapAllocatorContext *ctx) static void *_map_alloc(void* ctx_, ptrdiff_t size) { - if (size == 0) { - return NULL; - } + // if (size == 0) { + // return NULL; + // } THMapAllocatorContext *ctx = ctx_; void *data = NULL; @@ -336,8 +336,8 @@ static void *THMapAllocator_realloc(void* ctx, void* ptr, ptrdiff_t size) { } static void THMapAllocator_free(void* ctx_, void* data) { - if (data == NULL) - return; + // if (data == NULL) + // return; THMapAllocatorContext *ctx = ctx_;