mirror of
https://github.com/n64dev/cen64.git
synced 2025-04-02 10:31:54 -04:00
Add SSE2 codepaths where necessary (even if not complete), while still allowing the project to be compiled with SSSE3+ intrinsics.
29 lines
703 B
C
29 lines
703 B
C
//
|
|
// os/windows/dynarec.c
|
|
//
|
|
// Functions for allocating executable code buffers.
|
|
//
|
|
// This file is subject to the terms and conditions defined in
|
|
// 'LICENSE', which is part of this source code package.
|
|
//
|
|
|
|
#include "common.h"
|
|
#include "os/dynarec.h"
|
|
#include <windows.h>
|
|
|
|
extern HANDLE dynarec_heap;
|
|
|
|
// Allocates memory with execute permissions set.
|
|
void *alloc_dynarec_slab(struct dynarec_slab *slab, size_t size) {
|
|
if ((slab->ptr = HeapAlloc(dynarec_heap, HEAP_ZERO_MEMORY, size)) == NULL)
|
|
return NULL;
|
|
|
|
slab->size = size;
|
|
return slab->ptr;
|
|
}
|
|
|
|
// Frees memory acquired for a dynarec buffer.
|
|
void free_dynarec_slab(struct dynarec_slab *slab) {
|
|
HeapFree(dynarec_heap, 0, slab->ptr);
|
|
}
|
|
|