aboutsummaryrefslogtreecommitdiffstats
path: root/common/pffft.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-15 00:18:28 -0800
committerChris Robinson <[email protected]>2023-12-15 00:18:28 -0800
commitea5628061c4bc3a121f7f8e6448c037f425e6a7d (patch)
treeae8ca0a33c4b64f08fae6808eabe23c00d944fbe /common/pffft.h
parent760ada93e88d3c78f6613b52eb5ef15c1564ad80 (diff)
Add some noexcept for free functions
Diffstat (limited to 'common/pffft.h')
-rw-r--r--common/pffft.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/common/pffft.h b/common/pffft.h
index b31304f6..5ef03820 100644
--- a/common/pffft.h
+++ b/common/pffft.h
@@ -111,8 +111,9 @@ typedef enum pffft_transform_t pffft_transform_t;
* structure is read-only so it can safely be shared by multiple concurrent
* threads.
*/
+[[gnu::malloc]]
PFFFT_Setup *pffft_new_setup(unsigned int N, pffft_transform_t transform);
-void pffft_destroy_setup(PFFFT_Setup *setup);
+void pffft_destroy_setup(PFFFT_Setup *setup) noexcept;
/**
* Perform a Fourier transform. The z-domain data is stored in the most
@@ -183,11 +184,12 @@ void pffft_zconvolve_accumulate(const PFFFT_Setup *setup, const float *dft_a, co
* and powerpc). This function may be used to obtain such correctly aligned
* buffers.
*/
+[[gnu::alloc_size(1), gnu::malloc]]
void *pffft_aligned_malloc(size_t nb_bytes);
-void pffft_aligned_free(void *ptr);
+void pffft_aligned_free(void *ptr) noexcept;
/* Return 4 or 1 depending if vectorization was enable when building pffft.cpp. */
-int pffft_simd_size();
+int pffft_simd_size() noexcept;
#ifdef __cplusplus
}
@@ -197,7 +199,7 @@ struct PFFFTSetup {
PFFFTSetup() = default;
PFFFTSetup(const PFFFTSetup&) = delete;
- PFFFTSetup(PFFFTSetup&& rhs) : mSetup{rhs.mSetup} { rhs.mSetup = nullptr; }
+ PFFFTSetup(PFFFTSetup&& rhs) noexcept : mSetup{rhs.mSetup} { rhs.mSetup = nullptr; }
explicit PFFFTSetup(std::nullptr_t) { }
explicit PFFFTSetup(unsigned int n, pffft_transform_t transform)
: mSetup{pffft_new_setup(n, transform)}
@@ -205,7 +207,7 @@ struct PFFFTSetup {
~PFFFTSetup() { if(mSetup) pffft_destroy_setup(mSetup); }
PFFFTSetup& operator=(const PFFFTSetup&) = delete;
- PFFFTSetup& operator=(PFFFTSetup&& rhs)
+ PFFFTSetup& operator=(PFFFTSetup&& rhs) noexcept
{
if(mSetup)
pffft_destroy_setup(mSetup);