use std::malloc() in examples