diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-11-26 06:20:17 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-11-26 06:20:17 +0000 |
commit | efbcbeff470c0b8d1df5a4eb64dd3b292cfc0af3 (patch) | |
tree | 1b287a9d18a05fcbebd381e89bb7b4ef516b9aaa /lib/libc/stdio/vfprintf.c | |
parent | eedb97188836f1f97b1101b2c052463c0404abeb (diff) |
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); |