bson allocation functions.