You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
397 B
C

16 years ago
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
16 years ago
#include "iarray.h"
static void freechain(iarray_page* p,size_t pagesize) {
while (p) {
iarray_page* n=p->next;
munmap(p,pagesize);
p=n;
}
}
16 years ago
void iarray_free(iarray* ia) {
size_t i;
for (i=0; i<sizeof(ia->pages)/sizeof(ia->pages[0]); ++i) {
freechain(ia->pages[i],ia->bytesperpage);
ia->pages[i]=0;
}
16 years ago
}