xbt_error_name(errcode),gras_socket_peer_name(peer),request_ack->host.port);
return errcode;
}
- xbt_free(request_ack);
+ free(request_ack);
INFO0("Got ACK");
*sec=gras_os_time();
void amok_remoterr_free(amok_remoterr_t *err) {
if (err && *err) {
- if ((*err)->msg) xbt_free((*err)->msg);
- xbt_free(*err);
+ if ((*err)->msg) free((*err)->msg);
+ free(*err);
err=NULL;
}
}
static void free_string(void *d);
static void free_string(void *d){
- xbt_free(*(void**)d);
+ free(*(void**)d);
}
gras_cbps_t gras_cbps_new(void) {
xbt_dynar_free( &( (*state)->frames ) );
xbt_dynar_free( &( (*state)->globals ) );
- xbt_free(*state);
+ free(*state);
*state = NULL;
}
*ddt = var->type;
data = var->data;
- xbt_free(var);
+ free(var);
xbt_dynar_pop(ps->frames, &frame);
{
_name = xbt_dynar_get_as(frame, l, char*);
if (!strcmp(name, _name)) {
xbt_dynar_remove_at(frame, l, &_name);
- xbt_free(_name);
+ free(_name);
break;
}
}
xbt_dynar_free_container(&varstack); /*already empty, save a test ;) */
}
- if (var->data) xbt_free(var->data);
- xbt_free(var);
- xbt_free(name);
+ if (var->data) free(var->data);
+ free(var);
+ free(name);
}
xbt_dynar_free_container(&frame);/* we just emptied it */
DEBUG0("<<< Block end");
XBT_IN;
if (field) {
if (field->name)
- xbt_free(field->name);
- xbt_free(field);
+ free(field->name);
+ free(field);
}
XBT_OUT;
}
sprintf(name,"%s[]*",element_type->name);
res = gras_datadesc_ref(name,res);
- xbt_free(name);
+ free(name);
return res;
}
/* datadesc was invalid. Killing it is like euthanasy, I guess */
break;
}
- xbt_free((*type)->name);
- xbt_free(*type);
+ free((*type)->name);
+ free(*type);
type=NULL;
}
TRY(gras_trp_chunk_recv(sock, (char*)ptr, int_type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
TRY(gras_dd_convert_elm(int_type,1,r_arch, ptr,i));
- xbt_free(ptr);
+ free(ptr);
}
DEBUG1("recv_int(%d)",*i);
DEBUG2("Insert %p under %p",*(void**)ptr, *(void**)r_ref);
if (detect_cycle)
- xbt_dict_set_ext(refs,(const char *) r_ref, r_len, ptr, xbt_free_fct);
+ xbt_dict_set_ext(refs,(const char *) r_ref, r_len, ptr, free);
}
return no_error;
}
TRY(gras_trp_chunk_recv(sock, (char*)ptr, type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
TRY(gras_dd_convert_elm(type,1,r_arch, ptr,l_data));
- xbt_free(ptr);
+ free(ptr);
}
break;
VERB1("Not receiving data remotely referenced @%p since it's NULL",
*(void **)r_ref);
*(void**)l_data = NULL;
- xbt_free(r_ref);
+ free(r_ref);
break;
}
} else {
return errcode;
}
- xbt_free(r_ref);
+ free(r_ref);
break;
}
sub_type->size[r_arch] * count));
if (r_arch != GRAS_THISARCH)
TRY(gras_dd_convert_elm(sub_type,count,r_arch, ptr,l_data));
- xbt_free(ptr);
+ free(ptr);
}
} else if (sub_type->category_code == e_gras_datadesc_type_cat_array &&
sub_type->category.array_data.fixed_size > 0 &&
subsub_type->size[r_arch] * count*array_data.fixed_size));
if (r_arch != GRAS_THISARCH)
TRY(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, ptr,l_data));
- xbt_free(ptr);
+ free(ptr);
}
TRY(gras_trp_chunk_recv(sock, (char*)ptr, type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
TRY(gras_dd_convert_elm(type,1,r_arch, ptr,l_data));
- xbt_free(ptr);
+ free(ptr);
}
break;
VERB1("Not receiving data remotely referenced @%p since it's NULL",
*(void **)r_ref);
*(void**)l_data = NULL;
- xbt_free(r_ref);
+ free(r_ref);
break;
}
} else {
return errcode;
}
- xbt_free(r_ref);
+ free(r_ref);
break;
}
sub_type->size[r_arch] * count));
if (r_arch != GRAS_THISARCH)
TRY(gras_dd_convert_elm(sub_type,count,r_arch, ptr,l_data));
- xbt_free(ptr);
+ free(ptr);
}
} else if (sub_type->category_code == e_gras_datadesc_type_cat_array &&
sub_type->category.array_data.fixed_size > 0 &&
subsub_type->size[r_arch] * count*array_data.fixed_size));
if (r_arch != GRAS_THISARCH)
TRY(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, ptr,l_data));
- xbt_free(ptr);
+ free(ptr);
}
DEBUG2("Array specification (size=%ld, elm='%s'), change pushed type",
size,former.type_name);
sprintf(array.type_name,"%s[%ld]",former.type_name,size);
- xbt_free(former.type_name);
+ free(former.type_name);
array.type = gras_datadesc_array_fixed(array.type_name, former.type, size); /* redeclaration are ignored */
array.name = former.name;
ref.type_name=(char*)xbt_malloc(strlen(former.type->name)+2);
DEBUG1("Ref specification (elm='%s'), change pushed type", former.type_name);
sprintf(ref.type_name,"%s*",former.type_name);
- xbt_free(former.type_name);
+ free(former.type_name);
ref.type = gras_datadesc_ref(ref.type_name, former.type); /* redeclaration are ignored */
ref.name = former.name;
ref.type_name = (char*)strdup(ref.type->name);
ref.name = former.name;
- xbt_free(former.type_name);
+ free(former.type_name);
xbt_dynar_push(dynar,&ref);
XBT_OUT;
DEBUG2("Anotation: %s=%s",keyname,keyval);
if (!strcmp(keyname,"size")) {
- xbt_free(keyname);
+ free(keyname);
if (!identifier.tm.is_ref)
PARSE_ERROR0("Size annotation for a field not being a reference");
identifier.tm.is_ref--;
if (!strcmp(keyval,"1")) {
change_to_ref(identifiers);
- xbt_free(keyval);
+ free(keyval);
continue;
} else {
char *p;
if (fixed) {
change_to_fixed_array(identifiers,atoi(keyval));
change_to_ref(identifiers);
- xbt_free(keyval);
+ free(keyval);
continue;
} else {
VERB2("Append field '%s' to %p",field.name, (void*)struct_type);
gras_datadesc_struct_append(struct_type, field.name, field.type);
- xbt_free(field.name);
- xbt_free(field.type_name);
+ free(field.name);
+ free(field.type_name);
}
xbt_dynar_reset(identifiers);
DEBUG1("struct_type=%p",(void*)struct_type);
VERB2("Push field '%s' into size stack of %p", name, (void*)struct_type);
gras_datadesc_cb_field_push(struct_type, name);
- xbt_free(name);
+ free(name);
}
xbt_dynar_reset(fields_to_push);
}
gras_ddt_parse_pointer_string_close();
VERB0("end of _gras_ddt_type_parse()");
- xbt_free(definition);
+ free(definition);
/* register it under the name provided as symbol */
if (strcmp(res->name,name)) {
ERROR2("In GRAS_DEFINE_TYPE, the provided symbol (here %s) must be the C type name (here %s)",
void gras_msgtype_free(void *t) {
gras_msgtype_t msgtype=(gras_msgtype_t)t;
if (msgtype) {
- xbt_free(msgtype->name);
- xbt_free(msgtype);
+ free(msgtype->name);
+ free(msgtype);
}
}
if (!res)
WARN1("msgtype_by_name(%s) returns NULL",namev);
if (name != namev)
- xbt_free(namev);
+ free(namev);
return res;
}
"Got error %s while retrieving the type associated to messages '%s'",
xbt_error_name(errcode),msg_name);
/* FIXME: Survive unknown messages */
- xbt_free(msg_name);
+ free(msg_name);
*payload_size=gras_datadesc_size((*msgtype)->ctn_type);
xbt_assert2(*payload_size > 0,
if (msg.type->code == msgt_want->code) {
*expeditor = msg.expeditor;
memcpy(payload, msg.payload, msg.payload_size);
- xbt_free(msg.payload);
+ free(msg.payload);
xbt_dynar_cursor_rm(pd->msg_queue, &cpt);
VERB0("The waited message was queued");
return no_error;
TRY(gras_msg_recv(*expeditor, &msgt_got, &payload_got, &payload_size_got));
if (msgt_got->code == msgt_want->code) {
memcpy(payload, payload_got, payload_size_got);
- xbt_free(payload_got);
+ free(payload_got);
VERB0("Got waited message");
return no_error;
}
cpt+1,cb,msgtype->name);
if ((*cb)(expeditor,payload)) {
/* cb handled the message */
- xbt_free(payload);
+ free(payload);
return no_error;
}
}
gras_cblist_t *list=*(void**)data;
if (list) {
xbt_dynar_free(&( list->cbs ));
- xbt_free(list);
+ free(list);
}
}
switch (errcode) {
case mismatch_error:
/* SG plugin return mismatch when in RL mode (and vice versa) */
- xbt_free(plug->name);
- xbt_free(plug);
+ free(plug->name);
+ free(plug);
break;
case no_error:
plug->exit(plug);
} else if (plug->data) {
DEBUG1("Plugin %s lacks exit(). Free data anyway.",plug->name);
- xbt_free(plug->data);
+ free(plug->data);
}
- xbt_free(plug->name);
- xbt_free(plug);
+ free(plug->name);
+ free(plug);
}
}
sock->accepting?'y':'n');
if (errcode != no_error) {
- xbt_free(sock);
+ free(sock);
return errcode;
}
sock->accepting?'y':'n');
if (errcode != no_error) {
- xbt_free(sock);
+ free(sock);
return errcode;
}
/* free the memory */
if (sock->peer_name)
- xbt_free(sock->peer_name);
- xbt_free(sock);
+ free(sock->peer_name);
+ free(sock);
return;
}
}
exp_sofar,exp_size,msg_size,
gras_socket_peer_name(peer), gras_socket_peer_port(peer));
- xbt_free(chunk);
+ free(chunk);
return no_error;/* gras_socket_raw_exchange(peer,1,timeout,expSize,msgSize); */
}
exp_sofar,exp_size,msg_size,
gras_socket_peer_name(peer), gras_socket_peer_port(peer));
- xbt_free(chunk);
+ free(chunk);
return no_error;/* gras_socket_raw_exchange(peer,0,timeout,expSize,msgSize); */
}
if (data->in.size || data->out.size)
gras_trp_buf_flush(sock);
if (data->in.data)
- xbt_free(data->in.data);
+ free(data->in.data);
if (data->out.data)
- xbt_free(data->out.data);
- xbt_free(data);
+ free(data->out.data);
+ free(data);
super->socket_close(sock);
}
xbt_assert0(hd,"Please run gras_process_init on each process");
if (sock->data)
- xbt_free(sock->data);
+ free(sock->data);
if (sock->incoming) {
/* server mode socket. Un register it from 'OS' tables */
MSG_host_get_name(sock_data->to_host),
MSG_host_get_name(MSG_host_self()), sock_data->to_chan);
memcpy(data,task_data->data,size);
- xbt_free(task_data->data);
- xbt_free(task_data);
+ free(task_data->data);
+ free(task_data);
if (MSG_task_destroy(task) != MSG_OK)
RAISE0(unknown_error,"Error in MSG_task_destroy()");
void gras_trp_tcp_exit(gras_trp_plugin_t *plug) {
DEBUG1("Exit plugin TCP (free %p)", plug->data);
- xbt_free(plug->data);
+ free(plug->data);
}
xbt_error_t gras_trp_tcp_socket_client(gras_trp_plugin_t *self,
}
if (res_last == 0) {
/* No progress done, bail out */
- xbt_free(chunk);
+ free(chunk);
RAISE0(unknown_error,"Not exchanged a single byte, bailing out");
}
}
}
- xbt_free(chunk);
+ free(chunk);
return no_error;
}
fclose(msg_global->paje_output);
msg_global->paje_output = NULL;
}
- xbt_free(msg_global);
+ free(msg_global);
surf_finalize();
return MSG_OK;
for (i = 0; i < msg_global->max_channel; i++)
xbt_fifo_free(simdata->mbox[i]);
- xbt_free(simdata->mbox);
- xbt_free(simdata->sleeping);
+ free(simdata->mbox);
+ free(simdata->sleeping);
xbt_assert0((xbt_fifo_size(simdata->process_list)==0),
"Some process are still running on this host");
xbt_fifo_free(simdata->process_list);
- xbt_free(simdata);
+ free(simdata);
/* Clean host structure */
- xbt_free(host->name);
- xbt_free(host);
+ free(host->name);
+ free(host);
return;
}
xbt_fifo_remove(msg_global->process_list, arg);
xbt_fifo_remove(msg_global->process_to_run, arg);
xbt_fifo_remove(((m_process_t) arg)->simdata->host->simdata->process_list, arg);
- xbt_free(((m_process_t) arg)->name);
- xbt_free(((m_process_t) arg)->simdata);
- xbt_free(arg);
+ free(((m_process_t) arg)->name);
+ free(((m_process_t) arg)->simdata);
+ free(arg);
}
/** \ingroup m_process_management
xbt_assert0((xbt_dynar_length(task->simdata->sleeping)==0),
"Task still used. There is a problem. Cannot destroy it now!");
- if(task->name) xbt_free(task->name);
+ if(task->name) free(task->name);
xbt_dynar_free(&(task->simdata->sleeping));
if(action) action->resource_type->common_public->action_free(action);
- xbt_free(task->simdata);
- xbt_free(task);
+ free(task->simdata);
+ free(task);
return MSG_OK;
}
static void cpu_free(void *cpu)
{
- xbt_free(((cpu_Cas01_t)cpu)->name);
- xbt_free(cpu);
+ free(((cpu_Cas01_t)cpu)->name);
+ free(cpu);
}
static cpu_Cas01_t cpu_new(char *name, double power_scale,
xbt_swag_remove(action, action->state_set);
if(((surf_action_cpu_Cas01_t)action)->variable)
lmm_variable_free(maxmin_system, ((surf_action_cpu_Cas01_t)action)->variable);
- xbt_free(action);
+ free(action);
return;
}
xbt_swag_free(surf_cpu_resource->common_public->states.
failed_action_set);
xbt_swag_free(surf_cpu_resource->common_public->states.done_action_set);
- xbt_free(surf_cpu_resource->common_public);
- xbt_free(surf_cpu_resource->common_private);
- xbt_free(surf_cpu_resource->extension_public);
+ free(surf_cpu_resource->common_public);
+ free(surf_cpu_resource->common_private);
+ free(surf_cpu_resource->extension_public);
- xbt_free(surf_cpu_resource);
+ free(surf_cpu_resource);
surf_cpu_resource = NULL;
}
while ((cnst = extract_constraint(sys)))
lmm_cnst_free(sys, cnst);
- xbt_free(sys);
+ free(sys);
}
void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var)
lmm_variable_disable(sys, var);
memset(var->cnsts,0,var->cnsts_size*sizeof(s_lmm_element_t));
- xbt_free(var->cnsts);
- xbt_free(var);
+ free(var->cnsts);
+ free(var);
}
static void lmm_cnst_free(lmm_system_t sys, lmm_constraint_t cnst)
/* xbt_assert0(xbt_swag_size(&(cnst->element_set)), */
/* "This list should be empty!"); */
remove_active_constraint(sys, cnst);
- xbt_free(cnst);
+ free(cnst);
}
lmm_constraint_t lmm_constraint_new(lmm_system_t sys, void *id,
static void network_link_free(void *nw_link)
{
- xbt_free(((network_link_CM02_t)nw_link)->name);
- xbt_free(nw_link);
+ free(((network_link_CM02_t)nw_link)->name);
+ free(nw_link);
}
static network_link_CM02_t network_link_new(char *name,
static void network_card_free(void *nw_card)
{
- xbt_free(((network_card_CM02_t)nw_card)->name);
- xbt_free(nw_card);
+ free(((network_card_CM02_t)nw_card)->name);
+ free(nw_card);
}
static int network_card_new(const char *card_name)
link_list = (ROUTE(src_id, dst_id) = xbt_new0(network_link_CM02_t, nb_link));
for (i = 0; i < nb_link; i++) {
xbt_dict_get(network_link_set, links[i], (void *) &(link_list[i]));
- xbt_free(links[i]);
+ free(links[i]);
}
- xbt_free(links);
+ free(links);
}
static void parse_network_link(void)
xbt_swag_remove(action, action->state_set);
if(((surf_action_network_CM02_t)action)->variable)
lmm_variable_free(maxmin_system, ((surf_action_network_CM02_t)action)->variable);
- xbt_free(action);
+ free(action);
return;
}
failed_action_set);
xbt_swag_free(surf_network_resource->common_public->states.
done_action_set);
- xbt_free(surf_network_resource->common_public);
- xbt_free(surf_network_resource->common_private);
- xbt_free(surf_network_resource->extension_public);
+ free(surf_network_resource->common_public);
+ free(surf_network_resource->common_private);
+ free(surf_network_resource->extension_public);
- xbt_free(surf_network_resource);
+ free(surf_network_resource);
surf_network_resource = NULL;
for (i = 0; i < card_number; i++)
for (j = 0; j < card_number; j++)
- xbt_free(ROUTE(i,j));
- xbt_free(routing_table);
+ free(ROUTE(i,j));
+ free(routing_table);
routing_table = NULL;
- xbt_free(routing_table_size);
+ free(routing_table_size);
routing_table_size = NULL;
card_number = 0;
}
static void network_link_free(void *nw_link)
{
- xbt_free(((network_link_DASSF_t)nw_link)->name);
- xbt_free(nw_link);
+ free(((network_link_DASSF_t)nw_link)->name);
+ free(nw_link);
}
static network_link_DASSF_t network_link_new(char *name,
static void network_card_free(void *nw_card)
{
- xbt_free(((network_card_DASSF_t)nw_card)->name);
- xbt_free(nw_card);
+ free(((network_card_DASSF_t)nw_card)->name);
+ free(nw_card);
}
static int network_card_new(const char *card_name)
link_list = (ROUTE(src_id, dst_id) = xbt_new0(network_link_DASSF_t, nb_link));
for (i = 0; i < nb_link; i++) {
xbt_dict_get(network_link_set, links[i], (void *) &(link_list[i]));
- xbt_free(links[i]);
+ free(links[i]);
}
- xbt_free(links);
+ free(links);
}
static void parse_network_link(void)
xbt_swag_remove(action, action->state_set);
if(((surf_action_network_DASSF_t)action)->variable)
lmm_variable_free(maxmin_system, ((surf_action_network_DASSF_t)action)->variable);
- xbt_free(action);
+ free(action);
return;
}
failed_action_set);
xbt_swag_free(surf_network_resource->common_public->states.
done_action_set);
- xbt_free(surf_network_resource->common_public);
- xbt_free(surf_network_resource->common_private);
- xbt_free(surf_network_resource->extension_public);
+ free(surf_network_resource->common_public);
+ free(surf_network_resource->common_private);
+ free(surf_network_resource->extension_public);
- xbt_free(surf_network_resource);
+ free(surf_network_resource);
surf_network_resource = NULL;
for (i = 0; i < card_number; i++)
for (j = 0; j < card_number; j++)
- xbt_free(ROUTE(i,j));
- xbt_free(routing_table);
+ free(ROUTE(i,j));
+ free(routing_table);
routing_table = NULL;
- xbt_free(routing_table_size);
+ free(routing_table_size);
routing_table_size = NULL;
card_number = 0;
}
void surf_action_free(surf_action_t * action)
{
(*action)->resource_type->common_public->action_cancel(*action);
- xbt_free(*action);
+ free(*action);
*action = NULL;
}
tmgr_finalize();
surf_parse_lex_destroy();
if(path_name) {
- xbt_free(path_name);
+ free(path_name);
path_name = NULL;
}
}
h = xbt_new0(s_tmgr_history_t, 1);
- h->heap = xbt_heap_new(8, xbt_free); /* Why 8 ? Well, why not... */
+ h->heap = xbt_heap_new(8, free); /* Why 8 ? Well, why not... */
return h;
}
void tmgr_history_free(tmgr_history_t h)
{
xbt_heap_free(h->heap);
- xbt_free(h);
+ free(h);
}
tmgr_trace_t tmgr_trace_new(const char *filename)
if (!trace)
return;
xbt_dynar_free(&(trace->event_list));
- xbt_free(trace);
+ free(trace);
}
tmgr_trace_event_t tmgr_history_add_trace(tmgr_history_t h,
xbt_heap_push(h->heap, trace_event, event_date + event->delta);
trace_event->idx = 0;
} else { /* We don't need this trace_event anymore */
- xbt_free(trace_event);
+ free(trace_event);
}
return trace_event;
static void workstation_free(void *workstation)
{
- xbt_free(((workstation_CLM03_t)workstation)->name);
- xbt_free(workstation);
+ free(((workstation_CLM03_t)workstation)->name);
+ free(workstation);
}
static void create_workstations(void)
failed_action_set);
xbt_swag_free(surf_workstation_resource->common_public->states.done_action_set);
- xbt_free(surf_workstation_resource->common_public);
- xbt_free(surf_workstation_resource->common_private);
- xbt_free(surf_workstation_resource->extension_public);
+ free(surf_workstation_resource->common_public);
+ free(surf_workstation_resource->common_private);
+ free(surf_workstation_resource->extension_public);
- xbt_free(surf_workstation_resource);
+ free(surf_workstation_resource);
surf_workstation_resource = NULL;
}
/************ workstation creation *********/
static void workstation_free(void *workstation)
{
- xbt_free(((workstation_KCCFLN05_t)workstation)->name);
+ free(((workstation_KCCFLN05_t)workstation)->name);
xbt_dynar_free(&(((workstation_KCCFLN05_t)workstation)->incomming_communications));
xbt_dynar_free(&(((workstation_KCCFLN05_t)workstation)->outgoing_communications));
- xbt_free(workstation);
+ free(workstation);
}
static workstation_KCCFLN05_t workstation_new(const char *name,
static void network_link_free(void *nw_link)
{
- xbt_free(((network_link_KCCFLN05_t)nw_link)->name);
- xbt_free(nw_link);
+ free(((network_link_KCCFLN05_t)nw_link)->name);
+ free(nw_link);
}
static network_link_KCCFLN05_t network_link_new(char *name,
link_list = route->links = xbt_new0(network_link_KCCFLN05_t, nb_link);
for (i = 0; i < nb_link; i++) {
xbt_dict_get(network_link_set, links[i], (void *) &(link_list[i]));
- xbt_free(links[i]);
+ free(links[i]);
}
- xbt_free(links);
+ free(links);
route->impact_on_src=impact_on_src;
route->impact_on_dst=impact_on_src;
route->impact_on_src_with_other_recv=impact_on_src_with_other_recv;
}
}
- xbt_free(action);
+ free(action);
}
static double share_network_KCCFLN05_resources(double now)
xbt_swag_remove(action, action->state_set);
if(((surf_action_cpu_KCCFLN05_t)action)->variable)
lmm_variable_free(maxmin_system_cpu_KCCFLN05, ((surf_action_cpu_KCCFLN05_t)action)->variable);
- xbt_free(action);
+ free(action);
}
static void action_cpu_KCCFLN05_change_state(surf_action_t action,
xbt_swag_free(surf_cpu_resource->common_public->states.
failed_action_set);
xbt_swag_free(surf_cpu_resource->common_public->states.done_action_set);
- xbt_free(surf_cpu_resource->common_public);
- xbt_free(surf_cpu_resource->common_private);
- xbt_free(surf_cpu_resource->extension_public);
+ free(surf_cpu_resource->common_public);
+ free(surf_cpu_resource->common_private);
+ free(surf_cpu_resource->extension_public);
- xbt_free(surf_cpu_resource);
+ free(surf_cpu_resource);
surf_cpu_resource = NULL;
if (maxmin_system_cpu_KCCFLN05) {
failed_action_set);
xbt_swag_free(surf_network_resource->common_public->states.
done_action_set);
- xbt_free(surf_network_resource->common_public);
- xbt_free(surf_network_resource->common_private);
- xbt_free(surf_network_resource->extension_public);
+ free(surf_network_resource->common_public);
+ free(surf_network_resource->common_private);
+ free(surf_network_resource->extension_public);
- xbt_free(surf_network_resource);
+ free(surf_network_resource);
surf_network_resource = NULL;
for (i = 0; i < nb_workstation; i++)
for (j = 0; j < nb_workstation; j++)
- xbt_free(ROUTE(i,j).links);
- xbt_free(routing_table);
+ free(ROUTE(i,j).links);
+ free(routing_table);
routing_table = NULL;
nb_workstation = 0;
xbt_swag_free(surf_workstation_resource->common_public->states.failed_action_set);
xbt_swag_free(surf_workstation_resource->common_public->states.done_action_set);
- xbt_free(surf_workstation_resource->common_public);
- xbt_free(surf_workstation_resource->common_private);
- xbt_free(surf_workstation_resource->extension_public);
+ free(surf_workstation_resource->common_public);
+ free(surf_workstation_resource->common_private);
+ free(surf_workstation_resource->extension_public);
- xbt_free(surf_workstation_resource);
+ free(surf_workstation_resource);
surf_workstation_resource = NULL;
}
void xbt_cfg_host_free(void *d);
void xbt_cfg_str_free(void *d){
- xbt_free(*(void**)d);
+ free(*(void**)d);
}
void xbt_cfg_host_free(void *d){
xbt_host_t *h=(xbt_host_t*) *(void**)d;
if (h) {
- if (h->name) xbt_free(h->name);
- xbt_free(h);
+ if (h->name) free(h->name);
+ free(h);
}
}
if (!c) return;
xbt_dynar_free(&(c->content));
- xbt_free(c);
+ free(c);
}
/*----[ Registering stuff ]-----------------------------------------------*/
ERROR3("%s%s%s",
"Invalid config element descriptor: ",entry,
"; Should be <name>:<min nb>_to_<max nb>_<type>");
- xbt_free(entrycpy);
+ free(entrycpy);
xbt_abort();
}
*(tok++)='\0';
min=strtol(tok, &tok, 10);
if (!tok) {
ERROR1("Invalid minimum in config element descriptor %s",entry);
- xbt_free(entrycpy);
+ free(entrycpy);
xbt_abort();
}
ERROR3("%s%s%s",
"Invalid config element descriptor: ",entry,
"; Should be <name>:<min nb>_to_<max nb>_<type>");
- xbt_free(entrycpy);
+ free(entrycpy);
xbt_abort();
}
tok += strlen("_to_");
max=strtol(tok, &tok, 10);
if (!tok) {
ERROR1("Invalid maximum in config element descriptor %s",entry);
- xbt_free(entrycpy);
+ free(entrycpy);
xbt_abort();
}
ERROR3("%s%s%s",
"Invalid config element descriptor: ",entry,
"; Should be <name>:<min nb>_to_<max nb>_<type>");
- xbt_free(entrycpy);
+ free(entrycpy);
xbt_abort();
}
ERROR3("%s%s%s",
"Invalid type in config element descriptor: ",entry,
"; Should be one of 'string', 'int', 'host' or 'double'.");
- xbt_free(entrycpy);
+ free(entrycpy);
xbt_abort();
}
xbt_cfg_register(cfg,entrycpy,type,min,max);
- xbt_free(entrycpy); /* strdup'ed by dict mechanism, but cannot be const */
+ free(entrycpy); /* strdup'ed by dict mechanism, but cannot be const */
return no_error;
}
val=strchr(name,':');
if (!val) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
xbt_assert1(FALSE,
"Malformated option: '%s'; Should be of the form 'name:value'",
name);
break;
case mismatch_error:
ERROR1("No registrated variable corresponding to '%s'.",name);
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
return mismatch_error;
break;
default:
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
return errcode;
}
case xbt_cfgelm_string:
errcode = xbt_cfg_set_string(cfg, name, val);
if (errcode != no_error) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
return errcode;
}
break;
case xbt_cfgelm_int:
i=strtol(val, &val, 0);
if (val==NULL) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
xbt_assert1(FALSE,
"Value of option %s not valid. Should be an integer",
name);
errcode = xbt_cfg_set_int(cfg,name,i);
if (errcode != no_error) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
return errcode;
}
break;
case xbt_cfgelm_double:
d=strtod(val, &val);
if (val==NULL) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
xbt_assert1(FALSE,
"Value of option %s not valid. Should be a double",
name);
errcode = xbt_cfg_set_double(cfg,name,d);
if (errcode != no_error) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
return errcode;
}
break;
str=val;
val=strchr(val,':');
if (!val) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
xbt_assert1(FALSE,
"Value of option %s not valid. Should be an host (machine:port)",
name);
*(val++)='\0';
i=strtol(val, &val, 0);
if (val==NULL) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
xbt_assert1(FALSE,
"Value of option %s not valid. Should be an host (machine:port)",
name);
errcode = xbt_cfg_set_host(cfg,name,str,i);
if (errcode != no_error) {
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
return errcode;
}
break;
default:
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
RAISE1(unknown_error,"Type of config element %s is not valid.",name);
}
}
- xbt_free(optionlist_cpy);
+ free(optionlist_cpy);
return no_error;
}
static void xbt_context_destroy(xbt_context_t context)
{
- xbt_free(context);
+ free(context);
return;
}
(context->code) (context->argc,context->argv);
for(i=0;i<context->argc; i++)
- if(context->argv[i]) xbt_free(context->argv[i]);
- if(context->argv) xbt_free(context->argv);
+ if(context->argv[i]) free(context->argv[i]);
+ if(context->argv) free(context->argv);
if(context->cleanup_func)
context->cleanup_func(context->cleanup_arg);
xbt_swag_remove(context, context_living);
for(i=0;i<context->argc; i++)
- if(context->argv[i]) xbt_free(context->argv[i]);
- if(context->argv) xbt_free(context->argv);
+ if(context->argv[i]) free(context->argv[i]);
+ if(context->argv) free(context->argv);
if(context->cleanup_func)
context->cleanup_func(context->cleanup_arg);
xbt_dictelm_free( &( (*dict)->head ) );
(*dict)->head = NULL;
}
- xbt_free(*dict);
+ free(*dict);
*dict=NULL;
}
}
if (*cursor) {
xbt_dynar_free(&((*cursor)->keys));
xbt_dynar_free(&((*cursor)->key_lens));
- xbt_free(*cursor);
+ free(*cursor);
*cursor = NULL;
}
}
xbt_dynar_free(&(p_elm->sub));
if (p_elm->key) {
- xbt_free(p_elm->key);
+ free(p_elm->key);
}
if (p_elm->free_f && p_elm->content) {
p_elm->free_f(p_elm->content);
}
- xbt_free(p_elm);
+ free(p_elm);
*pp_elm = NULL;
}
}
CDEBUG0(dict_add, "--> Change the value of head");
_xbt_dictelm_change_value(p_head, data, free_f);
- xbt_free(key); /* Keep the key used in the tree */
+ free(key); /* Keep the key used in the tree */
return;
}
CDEBUG1(dict_add, "-> Change the value of the child %p", (void*)p_child);
_xbt_dictelm_change_value(p_child, data, free_f);
- xbt_free(key);
+ free(key);
return;
}
head->content = child->content;
head->free_f = child->free_f;
- xbt_free(head->key);
+ free(head->key);
head->key = child->key;
head->key_len = child->key_len;
xbt_dynar_free_container(&(head->sub)) ;
head->sub = child->sub;
- xbt_free(child);
+ free(child);
}
/**
printf("%.*s|(%d)", key_len-offset, key_string + offset, offset);
- xbt_free(key_string);
+ free(key_string);
}
}
if (old_data) {
memcpy(new_data, old_data, used_length);
_xbt_clear_mem(old_data, old_length);
- xbt_free(old_data);
+ free(old_data);
}
_xbt_clear_mem(new_data + used_length, new_length - used_length);
if ((*dynar)->data) {
_xbt_clear_mem((*dynar)->data, (*dynar)->size);
- xbt_free((*dynar)->data);
+ free((*dynar)->data);
}
_xbt_clear_mem(*dynar, sizeof(s_xbt_dynar_t));
- xbt_free(*dynar);
+ free(*dynar);
*dynar=NULL;
}
}
}
if (dynar->data)
- xbt_free(dynar->data);
+ free(dynar->data);
dynar->size = 0;
dynar->used = 0;
dst=xbt_malloc(dynar->elmsize);
xbt_dynar_remove_at(dynar,(*cursor)--,dst);
(dynar->free_f)(dst);
- xbt_free(dst);
+ free(dst);
} else {
DEBUG0("Ok, we dont care about the element without free function");
xbt_dynar_remove_at(dynar,(*cursor)--,NULL);
if (H->free)
for (i = 0; i < H->count; i++)
H->free(H->items[i].content);
- xbt_free(H->items);
- xbt_free(H);
+ free(H->items);
+ free(H);
return;
}
static void _free_setting(void *s) {
xbt_log_setting_t set=(xbt_log_setting_t)s;
if (set) {
- xbt_free(set->catname);
-/* xbt_free(set); FIXME: uncommenting this leads to segfault when more than one chunk is passed as gras-log */
+ free(set->catname);
+/* free(set); FIXME: uncommenting this leads to segfault when more than one chunk is passed as gras-log */
}
}
} else {
xbt_assert1(FALSE,"Unknown priority name: %s",eq+1);
}
- xbt_free(neweq);
+ free(neweq);
} else {
char buff[512];
snprintf(buff,min(512,eq - dot - 1),"%s",dot+1);
set = xbt_new(s_xbt_log_setting_t,1);
} else {
DEBUG0("Apply directly");
- xbt_free(set->catname);
+ free(set->catname);
xbt_log_threshold_set(cat,set->thresh);
}
}
- xbt_free(set);
- xbt_free(cs);
+ free(set);
+ free(cs);
}
void xbt_log_appender_set(xbt_log_category_t cat, xbt_log_appender_t app) {
if (*set) {
xbt_dict_free ( &( (*set)->dict ) );
xbt_dynar_free( &( (*set)->dynar ) );
- xbt_free(*set);
+ free(*set);
*set = NULL;
}
}
cursor=*curs;
if (! xbt_dynar_cursor_get( cursor->set->dynar,&(cursor->val),elm) ) {
- xbt_free(cursor);
+ free(cursor);
*curs=NULL;
return FALSE;
}
*/
void xbt_swag_free(xbt_swag_t swag)
{
- xbt_free(swag);
+ free(swag);
}
/** Creates a new swag.
}
fprintf(OUT, "%s", SIM_MAIN_POSTEMBULE);
fclose(OUT);
- xbt_free(filename);
+ free(filename);
}
static void generate_rl(char *project)
fprintf(OUT, RL_CODE, key,key);
fprintf(OUT, "\n%s\n",warning);
fclose(OUT);
- xbt_free(filename);
+ free(filename);
}
}
generate_rl(project_name);
generate_makefile(project_name, deployment_file);
- xbt_free(warning);
+ free(warning);
return 0;
}