From debb40b910e54b2d92a2f0c24920b2c4c9d0eb37 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 2 Mar 2015 00:24:47 +0100 Subject: removed last remaining "throw" specifications * They are harmful. I removed most of them a long time ago but kept some for their documenting character. However, they will always result in additional checks (runtime penalty) when the corresponding functions get called and cannot ensure that only the declared exceptions are thrown at compile time. --- src/main.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 126e360..ea192db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,12 +71,9 @@ static gchar *mung_file = NULL; sig_atomic_t sigint_occurred = FALSE; extern "C" { -static gpointer g_malloc_exception(gsize n_bytes) - throw (std::bad_alloc); -static gpointer g_calloc_exception(gsize n_blocks, gsize n_block_bytes) - throw (std::bad_alloc); -static gpointer g_realloc_exception(gpointer mem, gsize n_bytes) - throw (std::bad_alloc); +static gpointer g_malloc_exception(gsize n_bytes); +static gpointer g_calloc_exception(gsize n_blocks, gsize n_block_bytes); +static gpointer g_realloc_exception(gpointer mem, gsize n_bytes); static void sigint_handler(int signal); } @@ -203,7 +200,7 @@ public: }; static gpointer -g_malloc_exception(gsize n_bytes) throw (std::bad_alloc) +g_malloc_exception(gsize n_bytes) { gpointer p = malloc(n_bytes); @@ -213,7 +210,7 @@ g_malloc_exception(gsize n_bytes) throw (std::bad_alloc) } static gpointer -g_calloc_exception(gsize n_blocks, gsize n_block_bytes) throw (std::bad_alloc) +g_calloc_exception(gsize n_blocks, gsize n_block_bytes) { gpointer p = calloc(n_blocks, n_block_bytes); @@ -223,7 +220,7 @@ g_calloc_exception(gsize n_blocks, gsize n_block_bytes) throw (std::bad_alloc) } static gpointer -g_realloc_exception(gpointer mem, gsize n_bytes) throw (std::bad_alloc) +g_realloc_exception(gpointer mem, gsize n_bytes) { gpointer p = realloc(mem, n_bytes); -- cgit v1.2.3