Added implementation for pal_malloc_impl_v2.