if((m=(structF_MAP*)mmap(NULL,mapsz,PROT_READ|PROT_WRITE,MAP_PRIVATE|/*FIXME: MAP_POPULATE is ~8% faster but more memory intensive */ANONYMOUS_MAP,-1,0))==MAP_FAILED)
m=NULL;
else{
dumb=0;
madvise(m,mapsz,MADV_RANDOM|MADV_DONTFORK);
madvise(m,hdrsz,MADV_WILLNEED);
}
pthread_mutex_unlock(&fmap_mutex);
}else
if((m=(structF_MAP*)mmap(NULL,mapsz,PROT_READ|PROT_WRITE,MAP_PRIVATE|/*FIXME: MAP_POPULATE is ~8% faster but more memory intensive */ANONYMOUS_MAP,-1,0))==MAP_FAILED){
m=NULL;
}else{
dumb=0;
madvise(m,mapsz,MADV_RANDOM|MADV_DONTFORK);
}
#else
m=(structF_MAP*)cli_malloc(mapsz);
#endif
m=(structF_MAP*)cli_malloc(mapsz);
if(!m){
cli_warnmsg("fmap: map allocation failed\n");
pthread_mutex_unlock(&fmap_mutex);
returnNULL;
}
/* fault the header while we still have the lock - we DO context switch here a lot here :@ */