Use doca_buf like malloc

Hi, I was wondering if I could use doca_buf_set_data and doca_buf_get_data in the device (eg rp_rtt_template_dev_main.c), similar to the way I use malloc and assign values to the address.
What I am trying to do, is in the DOCA application programmable congestion control, try to store some data per flowtag, and I want to use malloc because I don’t know how may flowtags there will be, and if the overhead is too big to put it as a global variable.
Or is there a better way to do this? Any info would be helpful! Thanks