feat: better rtc framework which aims to remove single rtc restrictions.
[lunaix-os.git] / lunaix-os / kernel / mm / valloc.c
index a744ed1aeb091ac94f0f7562eb02cb27925fbc07..58e57b9b7e41bff86b60ec489730420db296f538 100644 (file)
@@ -31,7 +31,7 @@ valloc_init()
     for (size_t i = 0; i < CLASS_LEN(piles_names_dma); i++) {
         int size = 1 << (i + 7);
         piles_dma[i] = cake_new_pile(
-          piles_names_dma[i], size, size > 1024 ? 4 : 1, PILE_CACHELINE);
+          piles_names_dma[i], size, size > 1024 ? 4 : 1, PILE_ALIGN_CACHE);
     }
 }
 
@@ -95,6 +95,16 @@ vfree(void* ptr)
     __vfree(ptr, piles, CLASS_LEN(piles_names));
 }
 
+void
+vfree_safe(void* ptr)
+{
+    if (!ptr) {
+        return;
+    }
+
+    __vfree(ptr, piles, CLASS_LEN(piles_names));
+}
+
 void*
 valloc_dma(unsigned int size)
 {