Fix memory management bug and computational inefficiencies

- Fix mismatched new[]/free() to use proper delete[] in interface.hpp
- Fix incorrect dx4 calculation (should be dx2*dx2, not dx2*dx) in lookup_xsimd.cpp
- Fix redundant sinv calculation by using separate base variables in sin_cosf_dispatcher
- Remove unused variable declarations in lookup_avx.cpp
- Optimize reference backend to use sincosf() instead of separate sin/cos calls

Co-authored-by: wvbbreu <185333235+wvbbreu@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-10-29 16:23:35 +00:00
parent 3eb537d586
commit 3addf2b05e
4 changed files with 10 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ public:
return static_cast<void *>(new uint8_t[bytes]);
};
virtual void free_memory(void *ptr) const { std::free(ptr); };
virtual void free_memory(void *ptr) const { delete[] static_cast<uint8_t*>(ptr); };
// Compute sine for n elements
virtual void compute_sinf(size_t n, const float *x, float *s) const = 0;