DEADSOFTWARE

ported to osx-pcc
[flatwaifu.git] / src / memory.c
index bec045671e5a8f3202cefb02bd7f615cb5913c4d..af93fa6f7b00a2af6d1a9d5bacd6d0a028e3ee00 100644 (file)
@@ -22,7 +22,6 @@
 #include "glob.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <malloc.h>
 #include <string.h>
 #include "error.h"
 #include "files.h"
@@ -91,3 +90,13 @@ void M_unlock(void *p) {
   if(!resl[h]) return;
   --resl[h];
 }
+
+int M_locked (int h) {
+  h&=-1-0x8000;
+  return (h != -1) && (h != 0xFFFF) && (resl[h] != 0);
+}
+
+int M_was_locked (int h) {
+  h&=-1-0x8000;
+  return (h != -1) && (h != 0xFFFF) && (resp[h] != NULL);
+}