split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.

the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
This commit is contained in:
janwas committed 2011-04-30 13:01:45 +00:00
1 parent 6c915291cc
commit 4663ac0fe7
225 files changed
+916 -932

No files matched your search

@@ -227,7 +227,7 @@ template<> jsval ScriptInterface::ToJSVal<Grid<u16> >(JSContext* cx, const Grid<
return JSVAL_VOID;
js::TypedArray *tdest = js::TypedArray::fromJSObject(darray);
debug_assert(tdest->byteLength == len*sizeof(u16));
ENSURE(tdest->byteLength == len*sizeof(u16));
memcpy(tdest->data, val.m_Data, tdest->byteLength);