... | ... |
@@ -13759,22 +13759,6 @@ $as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h |
13759 | 13759 |
ac_cv_c_can_get_pagesize="yes" |
13760 | 13760 |
fi |
13761 | 13761 |
|
13762 |
-# Check whether --enable-mempool was given. |
|
13763 |
-if test "${enable_mempool+set}" = set; then : |
|
13764 |
- enableval=$enable_mempool; enable_mempool=$enableval |
|
13765 |
-else |
|
13766 |
- enable_mempool="yes" |
|
13767 |
-fi |
|
13768 |
- |
|
13769 |
-if test "$enable_mempool" = "yes"; then |
|
13770 |
- if test "$ac_cv_c_mmap_private" != "yes"; then |
|
13771 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (mmap not available or not usable)" >&5 |
|
13772 |
-$as_echo "$as_me: ****** mempool support disabled (mmap not available or not usable)" >&6;} |
|
13773 |
- else |
|
13774 |
- if test "$ac_cv_c_can_get_pagesize" != "yes"; then |
|
13775 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (pagesize cannot be determined)" >&5 |
|
13776 |
-$as_echo "$as_me: ****** mempool support disabled (pagesize cannot be determined)" >&6;} |
|
13777 |
- else |
|
13778 | 13762 |
|
13779 | 13763 |
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANON(YMOUS)" >&5 |
13780 | 13764 |
$as_echo_n "checking for MAP_ANON(YMOUS)... " >&6; } |
... | ... |
@@ -13836,6 +13820,22 @@ _ACEOF |
13836 | 13836 |
|
13837 | 13837 |
fi |
13838 | 13838 |
|
13839 |
+# Check whether --enable-mempool was given. |
|
13840 |
+if test "${enable_mempool+set}" = set; then : |
|
13841 |
+ enableval=$enable_mempool; enable_mempool=$enableval |
|
13842 |
+else |
|
13843 |
+ enable_mempool="yes" |
|
13844 |
+fi |
|
13845 |
+ |
|
13846 |
+if test "$enable_mempool" = "yes"; then |
|
13847 |
+ if test "$ac_cv_c_mmap_private" != "yes"; then |
|
13848 |
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (mmap not available or not usable)" >&5 |
|
13849 |
+$as_echo "$as_me: ****** mempool support disabled (mmap not available or not usable)" >&6;} |
|
13850 |
+ else |
|
13851 |
+ if test "$ac_cv_c_can_get_pagesize" != "yes"; then |
|
13852 |
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (pagesize cannot be determined)" >&5 |
|
13853 |
+$as_echo "$as_me: ****** mempool support disabled (pagesize cannot be determined)" >&6;} |
|
13854 |
+ else |
|
13839 | 13855 |
if test "$ac_cv_c_mmap_anonymous" = "no"; then |
13840 | 13856 |
{ $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (anonymous mmap not available)" >&5 |
13841 | 13857 |
$as_echo "$as_me: ****** mempool support disabled (anonymous mmap not available)" >&6;} |
... | ... |
@@ -438,6 +438,7 @@ AC_FUNC_FSEEKO |
438 | 438 |
dnl Check if anon maps are available, check if we can determine the page size |
439 | 439 |
AC_C_FUNC_MMAP_PRIVATE |
440 | 440 |
AC_C_FUNC_PAGESIZE |
441 |
+AC_C_FUNC_MMAP_ANONYMOUS |
|
441 | 442 |
AC_ARG_ENABLE([mempool],[ --disable-mempool disable memory pools], enable_mempool=$enableval, enable_mempool="yes") |
442 | 443 |
if test "$enable_mempool" = "yes"; then |
443 | 444 |
if test "$ac_cv_c_mmap_private" != "yes"; then |
... | ... |
@@ -446,7 +447,6 @@ if test "$enable_mempool" = "yes"; then |
446 | 446 |
if test "$ac_cv_c_can_get_pagesize" != "yes"; then |
447 | 447 |
AC_MSG_NOTICE([****** mempool support disabled (pagesize cannot be determined)]) |
448 | 448 |
else |
449 |
- AC_C_FUNC_MMAP_ANONYMOUS |
|
450 | 449 |
if test "$ac_cv_c_mmap_anonymous" = "no"; then |
451 | 450 |
AC_MSG_NOTICE([****** mempool support disabled (anonymous mmap not available)]) |
452 | 451 |
else |
... | ... |
@@ -160,8 +160,8 @@ static void fmap_aging(fmap_t *m) { |
160 | 160 |
} else { |
161 | 161 |
/* Insert sort onto a stack'd array - same performance as quickselect */ |
162 | 162 |
unsigned int insert_to = MIN(maxavail, avail) - 1, age = m->bitmap[i] & FM_MASK_COUNT; |
163 |
- if(avail <= maxavail || m->bitmap[freeme[maxavail]] & FM_MASK_COUNT > age) { |
|
164 |
- while(m->bitmap[freeme[insert_to]] & FM_MASK_COUNT > age) { |
|
163 |
+ if(avail <= maxavail || (m->bitmap[freeme[maxavail]] & FM_MASK_COUNT) > age) { |
|
164 |
+ while((m->bitmap[freeme[insert_to]] & FM_MASK_COUNT) > age) { |
|
165 | 165 |
freeme[insert_to + 1] = freeme[insert_to]; |
166 | 166 |
if(!insert_to--) break; |
167 | 167 |
} |
... | ... |
@@ -277,15 +277,6 @@ static int cli_ddump(int desc, int offset, int size, const char *file) { |
277 | 277 |
} |
278 | 278 |
*/ |
279 | 279 |
|
280 |
-static off_t cli_seeksect(int fd, struct cli_exe_section *s) { |
|
281 |
- off_t ret; |
|
282 |
- |
|
283 |
- if(!s->rsz) return 0; |
|
284 |
- if((ret=lseek(fd, s->raw, SEEK_SET)) == -1) |
|
285 |
- cli_dbgmsg("cli_seeksect: lseek() failed\n"); |
|
286 |
- return ret+1; |
|
287 |
-} |
|
288 |
- |
|
289 | 280 |
static unsigned int cli_md5sect(fmap_t *map, struct cli_exe_section *s, unsigned char *digest) { |
290 | 281 |
void *hashme; |
291 | 282 |
cli_md5_ctx md5; |