Browse Source

J/j is a three valued option, document and fix code to actuall support that

with a little help from jmc@ for the man page bits
ok jca@  and a reluctant tedu@
OPENBSD_6_0
otto 8 years ago
parent
commit
48a1ebbb9c
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/lib/libc/stdlib/malloc.c

+ 5
- 3
src/lib/libc/stdlib/malloc.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: malloc.c,v 1.191 2016/06/30 09:00:48 otto Exp $ */
/* $OpenBSD: malloc.c,v 1.192 2016/07/06 20:32:02 otto Exp $ */
/* /*
* Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net> * Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@ -533,10 +533,12 @@ omalloc_parseopt(char opt)
mopts.malloc_hint = 1; mopts.malloc_hint = 1;
break; break;
case 'j': case 'j':
mopts.malloc_junk = 0;
if (mopts.malloc_junk > 0)
mopts.malloc_junk--;
break; break;
case 'J': case 'J':
mopts.malloc_junk = 2;
if (mopts.malloc_junk < 2)
mopts.malloc_junk++;
break; break;
case 'n': case 'n':
case 'N': case 'N':


Loading…
Cancel
Save