Browse Source

fix(thd): subtract ptr by kstack size on freeing

greatbridf 2 năm trước cách đây
mục cha
commit
38c7861ce7
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      include/kernel/process.hpp

+ 1 - 1
include/kernel/process.hpp

@@ -95,7 +95,7 @@ public:
     constexpr ~thread()
     {
         if (kstack)
-            free_n_raw_pages(to_page(kstack), 2);
+            free_n_raw_pages(to_page(kstack - THREAD_KERNEL_STACK_SIZE), 2);
     }
 };