mirror of /home/gitosis/repositories/libowfat.git
Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat
https://www.fefe.de/libowfat/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
469 B
26 lines
469 B
#include <stdlib.h> |
|
#ifndef __MINGW32__ |
|
#include <sys/mman.h> |
|
#endif |
|
#include <unistd.h> |
|
#include "iarray.h" |
|
|
|
static void freechain(iarray_page* p,size_t pagesize) { |
|
while (p) { |
|
iarray_page* n=p->next; |
|
#ifdef __MINGW32__ |
|
free(p); |
|
#else |
|
munmap(p,pagesize); |
|
#endif |
|
p=n; |
|
} |
|
} |
|
|
|
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; |
|
} |
|
}
|
|
|