summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-06-17 17:51:27 +0200
committerMax Kellermann <max@duempel.org>2016-06-17 17:59:45 +0200
commit9500343d85f9b5cd9a046a022e28cc1b7e6de7d1 (patch)
treedbe882246efde398087a2b47dca530c0ab4ec800 /src/util
parentef053035d07318cba05c9766aa5ed69cb380a464 (diff)
util/HugeAllocator: add "noexcept"
Diffstat (limited to 'src/util')
-rw-r--r--src/util/HugeAllocator.cxx4
-rw-r--r--src/util/HugeAllocator.hxx12
2 files changed, 8 insertions, 8 deletions
diff --git a/src/util/HugeAllocator.cxx b/src/util/HugeAllocator.cxx
index bbff91650..4e559532b 100644
--- a/src/util/HugeAllocator.cxx
+++ b/src/util/HugeAllocator.cxx
@@ -81,13 +81,13 @@ HugeAllocate(size_t size) throw(std::bad_alloc)
}
void
-HugeFree(void *p, size_t size)
+HugeFree(void *p, size_t size) noexcept
{
munmap(p, AlignToPageSize(size));
}
void
-HugeDiscard(void *p, size_t size)
+HugeDiscard(void *p, size_t size) noexcept
{
#ifdef MADV_DONTNEED
madvise(p, AlignToPageSize(size), MADV_DONTNEED);
diff --git a/src/util/HugeAllocator.hxx b/src/util/HugeAllocator.hxx
index 7619c5b96..569fa9436 100644
--- a/src/util/HugeAllocator.hxx
+++ b/src/util/HugeAllocator.hxx
@@ -52,7 +52,7 @@ HugeAllocate(size_t size) throw(std::bad_alloc);
* @param size the allocation's size as passed to HugeAllocate()
*/
void
-HugeFree(void *p, size_t size);
+HugeFree(void *p, size_t size) noexcept;
/**
* Discard any data stored in the allocation and give the memory back
@@ -63,7 +63,7 @@ HugeFree(void *p, size_t size);
* @param size the allocation's size as passed to HugeAllocate()
*/
void
-HugeDiscard(void *p, size_t size);
+HugeDiscard(void *p, size_t size) noexcept;
#elif defined(WIN32)
#include <windows.h>
@@ -73,13 +73,13 @@ void *
HugeAllocate(size_t size) throw(std::bad_alloc);
static inline void
-HugeFree(void *p, gcc_unused size_t size)
+HugeFree(void *p, gcc_unused size_t size) noexcept
{
VirtualFree(p, 0, MEM_RELEASE);
}
static inline void
-HugeDiscard(void *p, size_t size)
+HugeDiscard(void *p, size_t size) noexcept
{
VirtualAlloc(p, size, MEM_RESET, PAGE_NOACCESS);
}
@@ -98,14 +98,14 @@ HugeAllocate(size_t size) throw(std::bad_alloc)
}
static inline void
-HugeFree(void *_p, size_t)
+HugeFree(void *_p, size_t) noexcept
{
auto *p = (uint8_t *)_p;
delete[] p;
}
static inline void
-HugeDiscard(void *, size_t)
+HugeDiscard(void *, size_t) noexcept
{
}