Commit Graph

10 Commits

Author SHA1 Message Date
Brian Behlendorf 615e289a57 Revert "Remove declarations in VERIFY3_IMPL to save stack"
This reverts commit 421d95b3ea.

Ricardo correctly pointed out that there is more going on here than
typecasting.  By removing the locals we are actually causing LEFT and
RIGHT to be evaluated twice which can potentially lead to some
strange side effects as:

1) VERIFY3*() causing a panic but in the panic message the values
look correct such that the assertion shouldn't fail, or:

2) if LEFT or RIGHT are expressions with side-effects (e.g. a call
to a function which changes some state), then when we panic and
examine the crash dump, it may lead to an unexpected state because
we are not expecting certain things to change during the panic,
after the expressions inside VERIFY3*(...) have been evaluated.

3) Also, it may lead to double-panics or deadlocks during panics,
like for example, if the expressions inside VERIFY3*(...) only expect
to be called once (e.g. because they acquire a mutex).
2010-08-06 11:08:24 -07:00
Brian Behlendorf 0fd353341a Revert "remove compiler warning on 32-bit systems"
This reverts commit 80819cc01e.
2010-08-06 11:08:11 -07:00
Ned Bass 80819cc01e remove compiler warning on 32-bit systems
commit 421d95b3ea introduced a compiler
warning on 32-bit systems about casting a pointer to an integer of a
different size.  This commit removes the warning by casting the arguments
to snprintf in the same manner as the original VERIFY3_IMPL macro.
2010-08-04 09:38:44 -07:00
Ned Bass 421d95b3ea Remove declarations in VERIFY3_IMPL to save stack
This has a minor impact on stack usage of individual functions, but the
VERIFY macros are used so frequently that their overhead may add up.
This macro declared two new local variables to cast its argument types.
Doing the typecast inline eliminates the need for these variables.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-02 13:34:48 -07:00
Brian Behlendorf 18b7a966e4 Minor build fixes from asm-generic change.
- Drop _NOTE(CONSTCOND) usage in libspl this is Solaris specific.
- Resolve conflicting OR and AND long prototypes.
2009-07-16 13:37:59 -07:00
Brian Behlendorf 9cf1451c53 Add ASSERTV macro to simplify removing variables (the V in ASSERTV)
when they are only used in ASSERTs which will be compiled out.
2009-07-09 12:08:40 -07:00
Brian Behlendorf 6d524f2906 Cleanup some of the #ifndef/#defines 2008-12-17 10:06:55 -08:00
Brian Behlendorf 5945ae3161 Move verify/assert userspace functionality to libspl to simply everything, this way it only lives in one place where you need to build with libzfs.h or zfs_context.h 2008-12-17 09:43:11 -08:00
Brian Behlendorf 4d6a2499f6 Minor update to assert, pull include_next out of ifdef 2008-12-16 09:35:40 -08:00
Brian Behlendorf d46b60f374 Move libspl to new location 2008-12-11 15:06:34 -08:00