提交 64d15277 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

make VERIFYFREE work again, fix crange nit

上级 76e79edd
...@@ -91,6 +91,7 @@ range::~range() ...@@ -91,6 +91,7 @@ range::~range()
for (int l = 0; l < nlevel; l++) { for (int l = 0; l < nlevel; l++) {
next[l] = (struct range *) 0xDEADBEEF; next[l] = (struct range *) 0xDEADBEEF;
} }
destroylock(lock);
kmalignfree(lock, CACHELINE, sizeof(struct spinlock)); kmalignfree(lock, CACHELINE, sizeof(struct spinlock));
delete[] next; delete[] next;
} }
......
...@@ -296,12 +296,10 @@ verifyfree(char *ptr, u64 nbytes) ...@@ -296,12 +296,10 @@ verifyfree(char *ptr, u64 nbytes)
// Search for pointers in the ptr region // Search for pointers in the ptr region
u64 x = *(uptr *)p; u64 x = *(uptr *)p;
if (KBASE < x && x < KBASE+(128ull<<30)) { if (KBASE < x && x < KBASE+(128ull<<30)) {
#if 0 /* maybe once this code is C++ */
struct klockstat *kls = (struct klockstat *) x; struct klockstat *kls = (struct klockstat *) x;
if (kls->magic == LOCKSTAT_MAGIC) if (kls->magic == LOCKSTAT_MAGIC)
panic("LOCKSTAT_MAGIC %p(%lu):%p->%p", panic("LOCKSTAT_MAGIC %p(%lu):%p->%p",
ptr, nbytes, p, kls); ptr, nbytes, p, kls);
#endif
} }
} }
#endif #endif
......
...@@ -55,6 +55,11 @@ initlock(spinlock *s, const char *m, int lockstat) ...@@ -55,6 +55,11 @@ initlock(spinlock *s, const char *m, int lockstat)
} }
static inline void static inline void
destroylock(spinlock *s)
{
}
static inline void
cv_wakeup(condvar *c) cv_wakeup(condvar *c)
{ {
pthread_cond_signal(&c->cv); pthread_cond_signal(&c->cv);
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论