diff options
author | 2006-11-26 06:20:16 +0000 | |
---|---|---|
committer | 2006-11-26 06:20:16 +0000 | |
commit | 99406816b307b02a13f9d847e1edfaff35529dd7 (patch) | |
tree | 611d58e09a8c3c34e94eb97c2d61cd976d96610b /lib/libc/stdio/vfprintf.c | |
parent | add the Linksys USB1000 (diff) | |
download | wireguard-openbsd-99406816b307b02a13f9d847e1edfaff35529dd7.tar.xz wireguard-openbsd-99406816b307b02a13f9d847e1edfaff35529dd7.zip |
try first mmap() allocation at pagesize, no need to re-mmap at every power
of 2 from 16 to pagesize(); ok otto
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r-- | lib/libc/stdio/vfprintf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index e4173e3e4e9..4d482a43f57 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfprintf.c,v 1.39 2006/10/29 18:45:55 deraadt Exp $ */ +/* $OpenBSD: vfprintf.c,v 1.40 2006/11/26 06:20:16 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -1158,6 +1158,9 @@ __grow_type_table(unsigned char **typetable, int *tablesize) unsigned char *oldtable = *typetable; int newsize = *tablesize * 2; + if (newsize < getpagesize()) + newsize = getpagesize(); + if (*tablesize == STATIC_ARG_TBL_SIZE) { *typetable = mmap(NULL, newsize, PROT_WRITE|PROT_READ, MAP_ANON|MAP_PRIVATE, -1, 0); |