From fb4e234b76afef1614699257cc5900434737aaca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Wed, 30 Jun 2021 18:35:30 +0200
Subject: [PATCH] tests

---
 tempsdb/chunks/base.pyx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tempsdb/chunks/base.pyx b/tempsdb/chunks/base.pyx
index 5c5aad8..4952a3c 100644
--- a/tempsdb/chunks/base.pyx
+++ b/tempsdb/chunks/base.pyx
@@ -169,7 +169,8 @@ cdef class Chunk:
 
         if self.pointer >= self.page_size:
             # Inform the OS that we don't need the header anymore
-            self.mmap.madvise(mmap.MADV_DONTNEED, 0, HEADER_SIZE+TIMESTAMP_SIZE)
+            if hasattr(self.mmap, 'madvise'):
+                self.mmap.madvise(mmap.MADV_DONTNEED, 0, HEADER_SIZE+TIMESTAMP_SIZE)
         return 0
 
     cdef object open_file(self, str path):
-- 
GitLab