Hi Xin,
As stated in pmemobj man page, there is exactly one root object per pool.
If you need to store more than one data structure in a pool (two or more lists, trees, etc.), then the root object structure can hold OIDs to all of them, i.e.:
POBJ_LAYOUT_BEGIN(my_layout);
POBJ_LAYOUT_ROOT(my_layout, struct my_root);
POBJ_LAYOUT_TOID(my_layout, struct my_list);
POBJ_LAYOUT_END(my_layout);
struct my_root {
TOID(my_list) list1;
TOID(my_list) list2;
/* could be more "roots" here */
};
struct my_list {
...
};
--
krzycz