bsd: avoid #define malloc() when possible

bsd uses a 3-argument variant of malloc() instead of the standard single-
argument malloc().  This causes problems when including standard headers
along with bsd headers.

Fix by using a function overload instead.  A #define is only used in C code.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
memory: allow using debug allocator in parallel with standard allocator

Minor changes, allowing dbg::malloc() to be used in parallel with ::malloc().
This allows use-after-free debugging when the misbehaving type is known or
suspected.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
memory: debug allocator helper

Add a helper template that defines the appropriate new/delete operators for
the debug allocator.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Merge branch dbg-alloc

Small debug allocator improvements.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>