<|start_filename|>tests/binding.cpp<|end_filename|>
#include "binding.h"

#include <stdio.h>
#include <stdlib.h>

namespace SSE2NEON
{
void *platformAlignedAlloc(size_t size)
{
    void *address;
    int ret = posix_memalign(&address, 16, size);
    if (ret != 0) {
        fprintf(stderr, "Error at File %s line number %d\n", __FILE__,
                __LINE__);
        exit(EXIT_FAILURE);
    }
    return address;
}

void platformAlignedFree(void *ptr)
{
    free(ptr);
}

}  // namespace SSE2NEON


<|start_filename|>tests/binding.h<|end_filename|>
#ifndef SSE2NEONBINDING_H
#define SSE2NEONBINDING_H

#include <stdlib.h>

// The SSE2NEON unit tests run both within our own internal project
// as well as within the open source framework.
// This header file is used to abstract any distinctions between
// those two build environments.
//
// Initially, this is for how 16 byte aligned memory is allocated
namespace SSE2NEON
{
void *platformAlignedAlloc(size_t size);
void platformAlignedFree(void *ptr);

}  // namespace SSE2NEON

#endif
