Use wqalloc for dirit

上级 323d260b
......@@ -22,8 +22,8 @@
#include "user.h"
#include "fs.h"
#include "lib.h"
#include "dirit.hh"
#include "wq.hh"
#include "dirit.hh"
#define ST_SIZE(st) (st).size
#define ST_TYPE(st) (st).type
#define ST_INO(st) (st).ino
......
......@@ -44,12 +44,12 @@ private:
static inline const char*
copy_value(dirit &it)
{
char *buf = (char*)malloc(256);
return it.name(buf, 256);
char *buf = (char*)wqalloc(DIRSIZ+1);
return it.name(buf, DIRSIZ+1);
}
static inline void
free_value(dirit &it, const char *name)
{
free((void*)name);
wqfree((void*)name);
}
......@@ -38,10 +38,10 @@ struct cwork : public work {
#define xallocwork(n) kmalloc(n, "xallocwork")
#define xfreework(p, sz) kmfree(p, sz)
#else
extern void* allocwork(unsigned long nbytes);
extern void freework(void *ptr);
#define xallocwork(n) allocwork(n)
#define xfreework(n, sz) freework(n)
extern void* wqalloc(unsigned long nbytes);
extern void wqfree(void *ptr);
#define xallocwork(n) wqalloc(n)
#define xfreework(n, sz) wqfree(n)
#endif
#include "wqfor.hh"
......@@ -30,7 +30,7 @@ refill(void)
}
void*
allocwork(unsigned long nbytes)
wqalloc(unsigned long nbytes)
{
assert(nbytes <= WQBLOCKSZ);
......@@ -44,7 +44,7 @@ allocwork(unsigned long nbytes)
}
void
freework(void *ptr)
wqfree(void *ptr)
{
wqblock* b = (wqblock*) ptr;
b->next = *block;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论