MCPcopy Create free account
hub / github.com/csound/csound / pffft_aligned_malloc

Function pffft_aligned_malloc

OOps/pffft.c:259–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257/* SSE and co like 16-bytes aligned pointers */
258#define MALLOC_V4SF_ALIGNMENT 64 // with a 64-byte alignment, we are even aligned on L2 cache lines...
259void *pffft_aligned_malloc(size_t nb_bytes) {
260 void *p, *p0 = malloc(nb_bytes + MALLOC_V4SF_ALIGNMENT);
261 if (!p0) return (void *) 0;
262 p = (void *) (((size_t) p0 + MALLOC_V4SF_ALIGNMENT) & (~((size_t) (MALLOC_V4SF_ALIGNMENT-1))));
263 *((void **) p - 1) = p0;
264 return p;
265}
266
267void pffft_aligned_free(void *p) {
268 if (p) free(*((void **) p - 1));

Callers 4

player_initFunction · 0.85
player_init2Function · 0.85
pffft_setupFunction · 0.85
pffft_new_setupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected