update gpulib_thread_if
[pcsx_rearmed.git] / deps / lightrec / memmanager.c
index 2e6b99b..2934d4c 100644 (file)
@@ -1,27 +1,15 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
- * Copyright (C) 2019-2020 Paul Cercueil <paul@crapouillou.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Copyright (C) 2019-2021 Paul Cercueil <paul@crapouillou.net>
  */
 
-#include "config.h"
+#include "lightrec-config.h"
 #include "lightrec-private.h"
 #include "memmanager.h"
 
 #include <stdlib.h>
-#if ENABLE_TINYMM
-#include <tinymm.h>
-#endif
 
-#ifdef ENABLE_THREADED_COMPILER
+#if ENABLE_THREADED_COMPILER
 #include <stdatomic.h>
 
 static atomic_uint lightrec_bytes[MEM_TYPE_END];
@@ -76,12 +64,7 @@ void * lightrec_malloc(struct lightrec_state *state,
 {
        void *ptr;
 
-#if ENABLE_TINYMM
-       if (type == MEM_FOR_IR)
-               ptr = tinymm_malloc(state->tinymm, len);
-       else
-#endif
-               ptr = malloc(len);
+       ptr = malloc(len);
        if (!ptr)
                return NULL;
 
@@ -95,12 +78,7 @@ void * lightrec_calloc(struct lightrec_state *state,
 {
        void *ptr;
 
-#if ENABLE_TINYMM
-       if (type == MEM_FOR_IR)
-               ptr = tinymm_zalloc(state->tinymm, len);
-       else
-#endif
-               ptr = calloc(1, len);
+       ptr = calloc(1, len);
        if (!ptr)
                return NULL;
 
@@ -113,12 +91,7 @@ void lightrec_free(struct lightrec_state *state,
                   enum mem_type type, unsigned int len, void *ptr)
 {
        lightrec_unregister(type, len);
-#if ENABLE_TINYMM
-       if (type == MEM_FOR_IR)
-               tinymm_free(state->tinymm, ptr);
-       else
-#endif
-               free(ptr);
+       free(ptr);
 }
 
 float lightrec_get_average_ipi(void)