mark_color = white;
XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
- simgrid::instr::Value rett(mark_value, mark_color, type);
+ new simgrid::instr::Value(mark_value, mark_color, type);
}
/** \ingroup TRACE_mark
this->values_ = xbt_dict_new_homogeneous(nullptr);
this->color_ = xbt_strdup(color);
- char str_id[INSTR_DEFAULT_STR_SIZE];
- snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", instr_new_paje_id());
- this->id_ = xbt_strdup(str_id);
+ this->id_ = bprintf("%lld", instr_new_paje_id());
if (father != nullptr){
xbt_dict_set(father->children_, key, this, nullptr);
if (name == nullptr || father == nullptr){
THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)");
}
- this->ret_ = xbt_new0(Value, 1);
- this->ret_->name_ = xbt_strdup(name);
- this->ret_->father_ = father;
- this->ret_->color_ = xbt_strdup(color);
+ this->name_ = xbt_strdup(name);
+ this->father_ = father;
+ this->color_ = xbt_strdup(color);
- char str_id[INSTR_DEFAULT_STR_SIZE];
- snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", instr_new_paje_id());
- this->ret_->id_ = xbt_strdup(str_id);
+ this->id_ = bprintf("%lld", instr_new_paje_id());
- xbt_dict_set(father->values_, name, ret_, nullptr);
- XBT_DEBUG("new value %s, child of %s", ret_->name_, ret_->father_->name_);
- LogEntityValue(this->ret_);
+ xbt_dict_set(father->values_, name, this, nullptr);
+ XBT_DEBUG("new value %s, child of %s", name_, father_->name_);
+ LogEntityValue(this);
};
simgrid::instr::Value::~Value()
ret = Value::get(name, father);
}
catch(xbt_ex& e) {
- Value rett(name, color, father);
- ret = rett.ret_;
+ ret = new Value(name, color, father);
}
return ret;
}
char* color_;
Type* father_;
- Value* ret_;
Value(const char* name, const char* color, Type* father);
~Value();
static Value* get_or_new(const char* name, const char* color, Type* father);
if (msg_process == nullptr){
msg_process = simgrid::instr::Type::containerNew("MSG_PROCESS", container->type_);
simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_PROCESS_STATE", msg_process);
- simgrid::instr::Value PJ_value("suspend", "1 0 1", state);
+ new simgrid::instr::Value("suspend", "1 0 1", state);
simgrid::instr::Value::get_or_new("sleep", "1 1 0", state);
simgrid::instr::Value::get_or_new("receive", "1 0 0", state);
simgrid::instr::Value::get_or_new("send", "0 0 1", state);
if (msg_vm == nullptr){
msg_vm = simgrid::instr::Type::containerNew("MSG_VM", container->type_);
simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_VM_STATE", msg_vm);
- simgrid::instr::Value PJ_value("suspend", "1 0 1", state);
+ new simgrid::instr::Value("suspend", "1 0 1", state);
simgrid::instr::Value::get_or_new("sleep", "1 1 0", state);
simgrid::instr::Value::get_or_new("receive", "1 0 0", state);
simgrid::instr::Value::get_or_new("send", "0 0 1", state);
simgrid::instr::Type* root)
{
if (not strcmp(root->name_, type_name)) {
- simgrid::instr::Value PJ_value(val, color, root);
+ new simgrid::instr::Value(val, color, root);
}
xbt_dict_cursor_t cursor = nullptr;
simgrid::instr::Type* child_type;