From a34dfd55be54173acd34ae56e1398a709238a7ff Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Jan 2017 10:32:21 +0100 Subject: [PATCH] util/HugeAllocator: remove deprepcated dynamic exception specifications --- src/util/HugeAllocator.cxx | 8 +++++--- src/util/HugeAllocator.hxx | 11 +++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/util/HugeAllocator.cxx b/src/util/HugeAllocator.cxx index 4e559532b..f6910ea99 100644 --- a/src/util/HugeAllocator.cxx +++ b/src/util/HugeAllocator.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2016 Max Kellermann + * Copyright (C) 2013-2017 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +29,8 @@ #include "HugeAllocator.hxx" +#include + #ifdef __linux__ #include #include @@ -54,7 +56,7 @@ AlignToPageSize(size_t size) } void * -HugeAllocate(size_t size) throw(std::bad_alloc) +HugeAllocate(size_t size) { size = AlignToPageSize(size); @@ -97,7 +99,7 @@ HugeDiscard(void *p, size_t size) noexcept #elif defined(WIN32) void * -HugeAllocate(size_t size) throw(std::bad_alloc) +HugeAllocate(size_t size) { // TODO: use MEM_LARGE_PAGES void *p = VirtualAlloc(nullptr, size, diff --git a/src/util/HugeAllocator.hxx b/src/util/HugeAllocator.hxx index b75501aa3..3c635147b 100644 --- a/src/util/HugeAllocator.hxx +++ b/src/util/HugeAllocator.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2016 Max Kellermann + * Copyright (C) 2013-2017 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,6 @@ #include "Compiler.h" -#include #include #include @@ -46,7 +45,7 @@ */ gcc_malloc void * -HugeAllocate(size_t size) throw(std::bad_alloc); +HugeAllocate(size_t size); /** * @param p an allocation returned by HugeAllocate() @@ -71,7 +70,7 @@ HugeDiscard(void *p, size_t size) noexcept; gcc_malloc void * -HugeAllocate(size_t size) throw(std::bad_alloc); +HugeAllocate(size_t size); static inline void HugeFree(void *p, gcc_unused size_t size) noexcept @@ -93,7 +92,7 @@ HugeDiscard(void *p, size_t size) noexcept gcc_malloc static inline void * -HugeAllocate(size_t size) throw(std::bad_alloc) +HugeAllocate(size_t size) { return new uint8_t[size]; } @@ -122,7 +121,7 @@ class HugeAllocation { public: HugeAllocation() = default; - HugeAllocation(size_t _size) throw(std::bad_alloc) + HugeAllocation(size_t _size) :data(HugeAllocate(_size)), size(_size) {} HugeAllocation(HugeAllocation &&src) noexcept