#include "os/os_memory.h"
#include "os/os_memory_debug.h"
+#include "os/os_thread.h"
#include "util/u_debug.h"
#include "util/u_debug_stack.h"
static struct list_head list = { &list, &list };
+pipe_static_mutex(list_mutex);
+
static unsigned long last_no = 0;
ftr = footer_from_header(hdr);
ftr->magic = DEBUG_MEMORY_MAGIC;
+ pipe_mutex_lock(list_mutex);
LIST_ADDTAIL(&hdr->head, &list);
+ pipe_mutex_unlock(list_mutex);
return data_from_header(hdr);
}
debug_assert(0);
}
+ pipe_mutex_lock(list_mutex);
LIST_DEL(&hdr->head);
+ pipe_mutex_unlock(list_mutex);
hdr->magic = 0;
ftr->magic = 0;
new_ftr = footer_from_header(new_hdr);
new_ftr->magic = DEBUG_MEMORY_MAGIC;
+ pipe_mutex_lock(list_mutex);
LIST_REPLACE(&old_hdr->head, &new_hdr->head);
+ pipe_mutex_unlock(list_mutex);
/* copy data */
new_ptr = data_from_header(new_hdr);