]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/9nfs/listalloc.c
upas/fs: remove imap lastread debounding
[plan9front.git] / sys / src / cmd / 9nfs / listalloc.c
1 #include <u.h>
2 #include <libc.h>
3
4 void*   listalloc(long, long);
5
6 void *
7 listalloc(long n, long size)
8 {
9         char *p, *base;
10
11         size = (size+sizeof(ulong)-1)/sizeof(ulong)*sizeof(ulong);
12         p = base = malloc(n*size);
13         while(--n > 0){
14                 *(char**)p = p+size;
15                 p += size;
16         }
17         *(char**)p = 0;
18         return base;
19 }