Hi,experts
I try to use the following code to set alloc_class
why set res is always equal to -1? What is wrong with my code? Need help!
Thanks
int sds_write_value = 0;
pmemobj_ctl_set(NULL, "sds.at_create", &sds_write_value);
if ((pop = pmemobj_create(poolpath.c_str(), POBJ_LAYOUT_NAME("test"),
poolsize,0666)) == NULL)
{
printf("failed to create pool. path is : %s\n",poolpath.c_str());
return ;
}
pobj_alloc_class_desc readclass;
pobj_alloc_class_desc AllocClass;
AllocClass.unit_size = 512;
AllocClass.alignment = 64;
AllocClass.units_per_block = 0;
AllocClass.class_id = 128;
AllocClass.header_type = POBJ_HEADER_COMPACT;
int res = pmemobj_ctl_set(pop, "heap.alloc_class.128.desc", &AllocClass);
printf("set res: %d\n",res);
res = pmemobj_ctl_get(pop, "heap.alloc_class.128.desc", &readclass);
printf("get res: %d\n",res);