Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/sys/sys Replace alloca(256) with an array.



details:   https://anonhg.NetBSD.org/src/rev/6632bce3a743
branches:  trunk
changeset: 783638:6632bce3a743
user:      dsl <dsl%NetBSD.org@localhost>
date:      Wed Jan 02 10:33:19 2013 +0000

description:
Replace alloca(256) with an array.
The code ended up using alloca() from libc - which 'just can't work' (tm).
It is also pointless!

diffstat:

 external/cddl/osnet/sys/sys/zfs_context.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 193071a28afd -r 6632bce3a743 external/cddl/osnet/sys/sys/zfs_context.h
--- a/external/cddl/osnet/sys/sys/zfs_context.h Wed Jan 02 09:53:58 2013 +0000
+++ b/external/cddl/osnet/sys/sys/zfs_context.h Wed Jan 02 10:33:19 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zfs_context.h,v 1.12 2011/11/21 17:51:03 christos Exp $        */
+/*     $NetBSD: zfs_context.h,v 1.13 2013/01/02 10:33:19 dsl Exp $     */
 
 /*
  * CDDL HEADER START
@@ -146,7 +146,7 @@
        const TYPE __left = (TYPE)(LEFT); \
        const TYPE __right = (TYPE)(RIGHT); \
        if (!(__left OP __right)) { \
-               char *__buf = alloca(256); \
+               char __buf[256]; \
                (void) snprintf(__buf, 256, "%s %s %s (0x%llx %s 0x%llx)", \
                        #LEFT, #OP, #RIGHT, \
                        (u_longlong_t)__left, #OP, (u_longlong_t)__right); \



Home | Main Index | Thread Index | Old Index