|
@@ -1,6 +1,8 @@
|
|
#include "custom_free.h"
|
|
#include "custom_free.h"
|
|
#include "other.h"
|
|
#include "other.h"
|
|
|
|
+#ifdef HAVE_LOCKS
|
|
#include "posix_lock.h"
|
|
#include "posix_lock.h"
|
|
|
|
+#endif /* HAVE_LOCKS */
|
|
#include "block_header.h"
|
|
#include "block_header.h"
|
|
|
|
|
|
void custom_free(heap_t* heap, void *ptr) {
|
|
void custom_free(heap_t* heap, void *ptr) {
|
|
@@ -10,8 +12,10 @@ void custom_free(heap_t* heap, void *ptr) {
|
|
|
|
|
|
size = get_size(ptr);
|
|
size = get_size(ptr);
|
|
fixed_list_id = map_size_to_list(heap, size);
|
|
fixed_list_id = map_size_to_list(heap, size);
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+#ifdef HAVE_LOCKS
|
|
posix_lock(heap);
|
|
posix_lock(heap);
|
|
|
|
+#endif /* HAVE_LOCKS */
|
|
|
|
|
|
if(fixed_list_id != -1) {
|
|
if(fixed_list_id != -1) {
|
|
current_maptable_node = heap->maptable_head;
|
|
current_maptable_node = heap->maptable_head;
|
|
@@ -37,6 +41,8 @@ void custom_free(heap_t* heap, void *ptr) {
|
|
|
|
|
|
// End of Stats
|
|
// End of Stats
|
|
|
|
|
|
|
|
+#ifdef HAVE_LOCKS
|
|
posix_unlock(heap);
|
|
posix_unlock(heap);
|
|
|
|
+#endif /* HAVE_LOCKS */
|
|
}
|
|
}
|
|
|
|
|