Added alloc_flags arg to db_graph_alloc() for ease of use