Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoumith <soumith@fb.com>2016-12-14 03:45:01 +0300
committersoumith <soumith@fb.com>2016-12-14 03:45:01 +0300
commit6b1be60be7922f32bd60ffd0452eb4a7342bea9b (patch)
tree0fd6cc8741bf317d1ce46092b404222fd2f5a6b4
parent8b5d132ee408df55d3ee4f9f3dba2e9844be4ba4 (diff)
small fixes to allocator
-rw-r--r--lib/TH/THAllocator.c1
-rw-r--r--lib/TH/THAllocator.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/TH/THAllocator.c b/lib/TH/THAllocator.c
index 4f4f04f..51ac69b 100644
--- a/lib/TH/THAllocator.c
+++ b/lib/TH/THAllocator.c
@@ -482,6 +482,7 @@ void THRefcountedMapAllocator_incref(THMapAllocatorContext *ctx, void *data)
int THRefcountedMapAllocator_decref(THMapAllocatorContext *ctx, void *data)
{
THError("refcounted file mapping not supported on your system");
+ return 0;
}
#endif
diff --git a/lib/TH/THAllocator.h b/lib/TH/THAllocator.h
index 18fc9ec..62dfe6f 100644
--- a/lib/TH/THAllocator.h
+++ b/lib/TH/THAllocator.h
@@ -24,6 +24,7 @@ typedef struct THAllocator {
*/
extern THAllocator THDefaultAllocator;
+#if defined(_WIN32) || defined(HAVE_MMAP)
/* file map allocator
*/
typedef struct THMapAllocatorContext_ THMapAllocatorContext;
@@ -39,5 +40,6 @@ TH_API int THRefcountedMapAllocator_decref(THMapAllocatorContext *ctx, void *dat
extern THAllocator THMapAllocator;
extern THAllocator THRefcountedMapAllocator;
+#endif // defined(_WIN32) || defined(HAVE_MMAP)
#endif