Remove unused POSIX_MMAP references
Change-Id: I6998e15f9ed2849a270033217c02e27c79ee8343
This commit is contained in:
parent
3c92144280
commit
91c75c5c23
3
configure
vendored
3
configure
vendored
@ -261,7 +261,6 @@ HAVE_LIST="
|
|||||||
${ARCH_EXT_LIST}
|
${ARCH_EXT_LIST}
|
||||||
vpx_ports
|
vpx_ports
|
||||||
pthread_h
|
pthread_h
|
||||||
sys_mman_h
|
|
||||||
unistd_h
|
unistd_h
|
||||||
"
|
"
|
||||||
EXPERIMENT_LIST="
|
EXPERIMENT_LIST="
|
||||||
@ -550,7 +549,6 @@ process_detect() {
|
|||||||
*)
|
*)
|
||||||
case $header in
|
case $header in
|
||||||
pthread.h) true;;
|
pthread.h) true;;
|
||||||
sys/mman.h) true;;
|
|
||||||
unistd.h) true;;
|
unistd.h) true;;
|
||||||
*) false;;
|
*) false;;
|
||||||
esac && enable_feature $var
|
esac && enable_feature $var
|
||||||
@ -567,7 +565,6 @@ int main(void) {return 0;}
|
|||||||
EOF
|
EOF
|
||||||
# check system headers
|
# check system headers
|
||||||
check_header pthread.h
|
check_header pthread.h
|
||||||
check_header sys/mman.h
|
|
||||||
check_header unistd.h # for sysconf(3) and friends.
|
check_header unistd.h # for sysconf(3) and friends.
|
||||||
|
|
||||||
check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports
|
check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports
|
||||||
|
@ -29,13 +29,6 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#if USE_POSIX_MMAP
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#include "vpx_ports/vpx_timer.h"
|
#include "vpx_ports/vpx_timer.h"
|
||||||
#include "vpx/vpx_encoder.h"
|
#include "vpx/vpx_encoder.h"
|
||||||
#include "vpx/vp8cx.h"
|
#include "vpx/vp8cx.h"
|
||||||
|
16
vpxstats.c
16
vpxstats.c
@ -26,17 +26,6 @@ int stats_open_file(stats_io_t *stats, const char *fpf, int pass) {
|
|||||||
stats->buf.buf = NULL;
|
stats->buf.buf = NULL;
|
||||||
res = (stats->file != NULL);
|
res = (stats->file != NULL);
|
||||||
} else {
|
} else {
|
||||||
#if USE_POSIX_MMAP
|
|
||||||
struct stat stat_buf;
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
fd = open(fpf, O_RDONLY);
|
|
||||||
stats->file = fdopen(fd, "rb");
|
|
||||||
fstat(fd, &stat_buf);
|
|
||||||
stats->buf.sz = stat_buf.st_size;
|
|
||||||
stats->buf.buf = mmap(NULL, stats->buf.sz, PROT_READ, MAP_PRIVATE, fd, 0);
|
|
||||||
res = (stats->buf.buf != NULL);
|
|
||||||
#else
|
|
||||||
size_t nbytes;
|
size_t nbytes;
|
||||||
|
|
||||||
stats->file = fopen(fpf, "rb");
|
stats->file = fopen(fpf, "rb");
|
||||||
@ -58,7 +47,6 @@ int stats_open_file(stats_io_t *stats, const char *fpf, int pass) {
|
|||||||
|
|
||||||
nbytes = fread(stats->buf.buf, 1, stats->buf.sz, stats->file);
|
nbytes = fread(stats->buf.buf, 1, stats->buf.sz, stats->file);
|
||||||
res = (nbytes == stats->buf.sz);
|
res = (nbytes == stats->buf.sz);
|
||||||
#endif /* USE_POSIX_MMAP */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@ -82,11 +70,7 @@ int stats_open_mem(stats_io_t *stats, int pass) {
|
|||||||
void stats_close(stats_io_t *stats, int last_pass) {
|
void stats_close(stats_io_t *stats, int last_pass) {
|
||||||
if (stats->file) {
|
if (stats->file) {
|
||||||
if (stats->pass == last_pass) {
|
if (stats->pass == last_pass) {
|
||||||
#if USE_POSIX_MMAP
|
|
||||||
munmap(stats->buf.buf, stats->buf.sz);
|
|
||||||
#else
|
|
||||||
free(stats->buf.buf);
|
free(stats->buf.buf);
|
||||||
#endif /* USE_POSIX_MMAP */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(stats->file);
|
fclose(stats->file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user