Ah sorry,

it's sys_malloc. This is an engine function.

http://manual.conitec.net/sys_malloc.htm

Try
bag* item_bag = sys_malloc(sizeof(bag));

When done, release the memory with
sys_free(bag);