diff options
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/ats_api_performance.c | 6 | ||||
-rw-r--r-- | src/ats/ats_api_scheduling.c | 4 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 6 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_normalization.c | 4 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_performance.c | 2 | ||||
-rw-r--r-- | src/ats/perf_ats_solver.c | 2 | ||||
-rw-r--r-- | src/ats/plugin_ats_mlp.c | 4 | ||||
-rw-r--r-- | src/ats/plugin_ats_proportional.c | 6 | ||||
-rwxr-xr-x | src/ats/plugin_ats_ril.c | 4 | ||||
-rw-r--r-- | src/ats/test_ats_api_bandwidth_consumption.c | 4 |
10 files changed, 21 insertions, 21 deletions
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c index 390531d9f..90e061c1d 100644 --- a/src/ats/ats_api_performance.c +++ b/src/ats/ats_api_performance.c | |||
@@ -628,7 +628,7 @@ GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
628 | { | 628 | { |
629 | struct GNUNET_ATS_PerformanceHandle *ph; | 629 | struct GNUNET_ATS_PerformanceHandle *ph; |
630 | 630 | ||
631 | ph = GNUNET_malloc (sizeof (struct GNUNET_ATS_PerformanceHandle)); | 631 | ph = GNUNET_new (struct GNUNET_ATS_PerformanceHandle); |
632 | ph->cfg = cfg; | 632 | ph->cfg = cfg; |
633 | ph->addr_info_cb = addr_info_cb; | 633 | ph->addr_info_cb = addr_info_cb; |
634 | ph->addr_info_cb_cls = addr_info_cb_cls; | 634 | ph->addr_info_cb_cls = addr_info_cb_cls; |
@@ -703,7 +703,7 @@ GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph, | |||
703 | struct PendingMessage *p; | 703 | struct PendingMessage *p; |
704 | struct ReservationRequestMessage *m; | 704 | struct ReservationRequestMessage *m; |
705 | 705 | ||
706 | rc = GNUNET_malloc (sizeof (struct GNUNET_ATS_ReservationContext)); | 706 | rc = GNUNET_new (struct GNUNET_ATS_ReservationContext); |
707 | rc->size = amount; | 707 | rc->size = amount; |
708 | rc->peer = *peer; | 708 | rc->peer = *peer; |
709 | rc->rcb = rcb; | 709 | rc->rcb = rcb; |
@@ -763,7 +763,7 @@ GNUNET_ATS_performance_list_addresses ( | |||
763 | if (NULL == infocb) | 763 | if (NULL == infocb) |
764 | return NULL ; | 764 | return NULL ; |
765 | 765 | ||
766 | alh = GNUNET_malloc (sizeof (struct GNUNET_ATS_AddressListHandle)); | 766 | alh = GNUNET_new (struct GNUNET_ATS_AddressListHandle); |
767 | alh->id = handle->id; | 767 | alh->id = handle->id; |
768 | handle->id++; | 768 | handle->id++; |
769 | alh->cb = infocb; | 769 | alh->cb = infocb; |
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index 1ef6ce095..7750ad1cf 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -967,7 +967,7 @@ GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
967 | { | 967 | { |
968 | struct GNUNET_ATS_SchedulingHandle *sh; | 968 | struct GNUNET_ATS_SchedulingHandle *sh; |
969 | 969 | ||
970 | sh = GNUNET_malloc (sizeof (struct GNUNET_ATS_SchedulingHandle)); | 970 | sh = GNUNET_new (struct GNUNET_ATS_SchedulingHandle); |
971 | sh->cfg = cfg; | 971 | sh->cfg = cfg; |
972 | sh->suggest_cb = suggest_cb; | 972 | sh->suggest_cb = suggest_cb; |
973 | sh->suggest_cb_cls = suggest_cb_cls; | 973 | sh->suggest_cb_cls = suggest_cb_cls; |
@@ -1083,7 +1083,7 @@ GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh, | |||
1083 | m->peer = *peer; | 1083 | m->peer = *peer; |
1084 | GNUNET_CONTAINER_DLL_insert_tail (sh->pending_head, sh->pending_tail, p); | 1084 | GNUNET_CONTAINER_DLL_insert_tail (sh->pending_head, sh->pending_tail, p); |
1085 | do_transmit (sh); | 1085 | do_transmit (sh); |
1086 | s = GNUNET_malloc (sizeof (struct GNUNET_ATS_SuggestHandle)); | 1086 | s = GNUNET_new (struct GNUNET_ATS_SuggestHandle); |
1087 | s->id = (*peer); | 1087 | s->id = (*peer); |
1088 | GNUNET_CONTAINER_DLL_insert_tail (sh->sug_head, sh->sug_tail, s); | 1088 | GNUNET_CONTAINER_DLL_insert_tail (sh->sug_head, sh->sug_tail, s); |
1089 | return s; | 1089 | return s; |
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index ddcff962b..2cdc12766 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -1240,7 +1240,7 @@ GAS_addresses_request_address (struct GAS_Addresses_Handle *handle, | |||
1240 | } | 1240 | } |
1241 | if (NULL == cur) | 1241 | if (NULL == cur) |
1242 | { | 1242 | { |
1243 | cur = GNUNET_malloc (sizeof (struct GAS_Addresses_Suggestion_Requests)); | 1243 | cur = GNUNET_new (struct GAS_Addresses_Suggestion_Requests); |
1244 | cur->id = (*peer); | 1244 | cur->id = (*peer); |
1245 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1245 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
1246 | "Adding new address suggestion request for `%s'\n", | 1246 | "Adding new address suggestion request for `%s'\n", |
@@ -1836,7 +1836,7 @@ GAS_addresses_preference_change (struct GAS_Addresses_Handle *handle, | |||
1836 | 1836 | ||
1837 | if (NULL == find_preference_client (handle, client)) | 1837 | if (NULL == find_preference_client (handle, client)) |
1838 | { | 1838 | { |
1839 | pc = GNUNET_malloc (sizeof (struct GAS_Addresses_Preference_Clients)); | 1839 | pc = GNUNET_new (struct GAS_Addresses_Preference_Clients); |
1840 | pc->client = client; | 1840 | pc->client = client; |
1841 | GNUNET_CONTAINER_DLL_insert (handle->preference_clients_head, | 1841 | GNUNET_CONTAINER_DLL_insert (handle->preference_clients_head, |
1842 | handle->preference_clients_tail, pc); | 1842 | handle->preference_clients_tail, pc); |
@@ -2091,7 +2091,7 @@ GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2091 | char *plugin_short; | 2091 | char *plugin_short; |
2092 | int c; | 2092 | int c; |
2093 | 2093 | ||
2094 | ah = GNUNET_malloc (sizeof (struct GAS_Addresses_Handle)); | 2094 | ah = GNUNET_new (struct GAS_Addresses_Handle); |
2095 | ah->running = GNUNET_NO; | 2095 | ah->running = GNUNET_NO; |
2096 | 2096 | ||
2097 | ah->stat = (struct GNUNET_STATISTICS_Handle *) stats; | 2097 | ah->stat = (struct GNUNET_STATISTICS_Handle *) stats; |
diff --git a/src/ats/gnunet-service-ats_normalization.c b/src/ats/gnunet-service-ats_normalization.c index 67fd32066..d75ebf42d 100644 --- a/src/ats/gnunet-service-ats_normalization.c +++ b/src/ats/gnunet-service-ats_normalization.c | |||
@@ -445,7 +445,7 @@ GAS_normalization_normalize_preference (void *src, | |||
445 | /* Not found: create new preference client */ | 445 | /* Not found: create new preference client */ |
446 | if (NULL == c_cur) | 446 | if (NULL == c_cur) |
447 | { | 447 | { |
448 | c_cur = GNUNET_malloc (sizeof (struct PreferenceClient)); | 448 | c_cur = GNUNET_new (struct PreferenceClient); |
449 | c_cur->client = src; | 449 | c_cur->client = src; |
450 | GNUNET_CONTAINER_DLL_insert(pc_head, pc_tail, c_cur); | 450 | GNUNET_CONTAINER_DLL_insert(pc_head, pc_tail, c_cur); |
451 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Adding new client %p \n", c_cur); | 451 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Adding new client %p \n", c_cur); |
@@ -459,7 +459,7 @@ GAS_normalization_normalize_preference (void *src, | |||
459 | /* Not found: create new peer entry */ | 459 | /* Not found: create new peer entry */ |
460 | if (NULL == p_cur) | 460 | if (NULL == p_cur) |
461 | { | 461 | { |
462 | p_cur = GNUNET_malloc (sizeof (struct PreferencePeer)); | 462 | p_cur = GNUNET_new (struct PreferencePeer); |
463 | p_cur->client = c_cur; | 463 | p_cur->client = c_cur; |
464 | p_cur->id = (*peer); | 464 | p_cur->id = (*peer); |
465 | for (i = 0; i < GNUNET_ATS_PreferenceCount; i++) | 465 | for (i = 0; i < GNUNET_ATS_PreferenceCount; i++) |
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c index 8aad96eea..b9d918103 100644 --- a/src/ats/gnunet-service-ats_performance.c +++ b/src/ats/gnunet-service-ats_performance.c | |||
@@ -307,7 +307,7 @@ GAS_performance_add_client (struct GNUNET_SERVER_Client *client, | |||
307 | struct PerformanceClient *pc; | 307 | struct PerformanceClient *pc; |
308 | GNUNET_break (NULL == find_client (client)); | 308 | GNUNET_break (NULL == find_client (client)); |
309 | 309 | ||
310 | pc = GNUNET_malloc (sizeof (struct PerformanceClient)); | 310 | pc = GNUNET_new (struct PerformanceClient); |
311 | pc->client = client; | 311 | pc->client = client; |
312 | pc->flag = flag; | 312 | pc->flag = flag; |
313 | 313 | ||
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c index 0cfc72c69..89d0d82e2 100644 --- a/src/ats/perf_ats_solver.c +++ b/src/ats/perf_ats_solver.c | |||
@@ -456,7 +456,7 @@ solver_info_cb (void *cls, | |||
456 | if ((GAS_STAT_SUCCESS == stat) && (NULL == ph.current_result)) | 456 | if ((GAS_STAT_SUCCESS == stat) && (NULL == ph.current_result)) |
457 | { | 457 | { |
458 | /* Create new result */ | 458 | /* Create new result */ |
459 | tmp = GNUNET_malloc (sizeof (struct Result)); | 459 | tmp = GNUNET_new (struct Result); |
460 | ph.current_result = tmp; | 460 | ph.current_result = tmp; |
461 | GNUNET_CONTAINER_DLL_insert_tail(ph.head, ph.tail, tmp); | 461 | GNUNET_CONTAINER_DLL_insert_tail(ph.head, ph.tail, tmp); |
462 | ph.current_result->addresses = ph.current_a; | 462 | ph.current_result->addresses = ph.current_a; |
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c index 0e6f60893..7dd31edf5 100644 --- a/src/ats/plugin_ats_mlp.c +++ b/src/ats/plugin_ats_mlp.c | |||
@@ -1672,7 +1672,7 @@ GAS_mlp_get_preferred_address (void *solver, | |||
1672 | LOG (GNUNET_ERROR_TYPE_INFO, "Adding peer `%s' to list of requested_peers with requests\n", | 1672 | LOG (GNUNET_ERROR_TYPE_INFO, "Adding peer `%s' to list of requested_peers with requests\n", |
1673 | GNUNET_i2s (peer)); | 1673 | GNUNET_i2s (peer)); |
1674 | 1674 | ||
1675 | p = GNUNET_malloc (sizeof (struct ATS_Peer)); | 1675 | p = GNUNET_new (struct ATS_Peer); |
1676 | p->id = (*peer); | 1676 | p->id = (*peer); |
1677 | p->f = get_peer_pref_value (mlp, peer); | 1677 | p->f = get_peer_pref_value (mlp, peer); |
1678 | GNUNET_CONTAINER_multipeermap_put (mlp->requested_peers, | 1678 | GNUNET_CONTAINER_multipeermap_put (mlp->requested_peers, |
@@ -1887,7 +1887,7 @@ void * | |||
1887 | libgnunet_plugin_ats_mlp_init (void *cls) | 1887 | libgnunet_plugin_ats_mlp_init (void *cls) |
1888 | { | 1888 | { |
1889 | struct GNUNET_ATS_PluginEnvironment *env = cls; | 1889 | struct GNUNET_ATS_PluginEnvironment *env = cls; |
1890 | struct GAS_MLP_Handle * mlp = GNUNET_malloc (sizeof (struct GAS_MLP_Handle)); | 1890 | struct GAS_MLP_Handle * mlp = GNUNET_new (struct GAS_MLP_Handle); |
1891 | 1891 | ||
1892 | double D; | 1892 | double D; |
1893 | double R; | 1893 | double R; |
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index 82a41d39f..62f571e5b 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c | |||
@@ -409,7 +409,7 @@ libgnunet_plugin_ats_proportional_init (void *cls) | |||
409 | GNUNET_assert(NULL != env->get_preferences); | 409 | GNUNET_assert(NULL != env->get_preferences); |
410 | GNUNET_assert(NULL != env->get_property); | 410 | GNUNET_assert(NULL != env->get_property); |
411 | 411 | ||
412 | s = GNUNET_malloc (sizeof (struct GAS_PROPORTIONAL_Handle)); | 412 | s = GNUNET_new (struct GAS_PROPORTIONAL_Handle); |
413 | s->env = env; | 413 | s->env = env; |
414 | env->sf.s_add = &GAS_proportional_address_add; | 414 | env->sf.s_add = &GAS_proportional_address_add; |
415 | env->sf.s_address_update_property = &GAS_proportional_address_property_changed; | 415 | env->sf.s_address_update_property = &GAS_proportional_address_property_changed; |
@@ -1572,12 +1572,12 @@ GAS_proportional_address_add (void *solver, struct ATS_Address *address, | |||
1572 | return; | 1572 | return; |
1573 | } | 1573 | } |
1574 | 1574 | ||
1575 | aw = GNUNET_malloc (sizeof (struct AddressWrapper)); | 1575 | aw = GNUNET_new (struct AddressWrapper); |
1576 | aw->addr = address; | 1576 | aw->addr = address; |
1577 | GNUNET_CONTAINER_DLL_insert(net->head, net->tail, aw); | 1577 | GNUNET_CONTAINER_DLL_insert(net->head, net->tail, aw); |
1578 | addresse_increment (s, net, GNUNET_YES, GNUNET_NO); | 1578 | addresse_increment (s, net, GNUNET_YES, GNUNET_NO); |
1579 | 1579 | ||
1580 | asi = GNUNET_malloc (sizeof (struct AddressSolverInformation)); | 1580 | asi = GNUNET_new (struct AddressSolverInformation); |
1581 | asi->network = net; | 1581 | asi->network = net; |
1582 | asi->calculated_quota_in_NBO = 0; | 1582 | asi->calculated_quota_in_NBO = 0; |
1583 | asi->calculated_quota_out_NBO = 0; | 1583 | asi->calculated_quota_out_NBO = 0; |
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c index db6ce5411..a918baa2b 100755 --- a/src/ats/plugin_ats_ril.c +++ b/src/ats/plugin_ats_ril.c | |||
@@ -1624,7 +1624,7 @@ agent_init (void *s, const struct GNUNET_PeerIdentity *peer) | |||
1624 | { | 1624 | { |
1625 | int i; | 1625 | int i; |
1626 | struct GAS_RIL_Handle * solver = s; | 1626 | struct GAS_RIL_Handle * solver = s; |
1627 | struct RIL_Peer_Agent * agent = GNUNET_malloc (sizeof (struct RIL_Peer_Agent)); | 1627 | struct RIL_Peer_Agent * agent = GNUNET_new (struct RIL_Peer_Agent); |
1628 | 1628 | ||
1629 | agent->envi = solver; | 1629 | agent->envi = solver; |
1630 | agent->peer = *peer; | 1630 | agent->peer = *peer; |
@@ -2045,7 +2045,7 @@ GAS_ril_address_add (void *solver, struct ATS_Address *address, uint32_t network | |||
2045 | agent = ril_get_agent (s, &address->peer, GNUNET_YES); | 2045 | agent = ril_get_agent (s, &address->peer, GNUNET_YES); |
2046 | 2046 | ||
2047 | //add address | 2047 | //add address |
2048 | address_wrapped = GNUNET_malloc (sizeof (struct RIL_Address_Wrapped)); | 2048 | address_wrapped = GNUNET_new (struct RIL_Address_Wrapped); |
2049 | address_wrapped->address_naked = address; | 2049 | address_wrapped->address_naked = address; |
2050 | GNUNET_CONTAINER_DLL_insert_tail(agent->addresses_head, agent->addresses_tail, address_wrapped); | 2050 | GNUNET_CONTAINER_DLL_insert_tail(agent->addresses_head, agent->addresses_tail, address_wrapped); |
2051 | 2051 | ||
diff --git a/src/ats/test_ats_api_bandwidth_consumption.c b/src/ats/test_ats_api_bandwidth_consumption.c index 74ee22cfb..493323657 100644 --- a/src/ats/test_ats_api_bandwidth_consumption.c +++ b/src/ats/test_ats_api_bandwidth_consumption.c | |||
@@ -189,8 +189,8 @@ run (void *cls, | |||
189 | end (); | 189 | end (); |
190 | return; | 190 | return; |
191 | } | 191 | } |
192 | p = GNUNET_malloc (sizeof (struct PeerContext)); | 192 | p = GNUNET_new (struct PeerContext); |
193 | addr = GNUNET_malloc (sizeof (struct Address)); | 193 | addr = GNUNET_new (struct Address); |
194 | 194 | ||
195 | atp = GNUNET_ATS_performance_init (cfg, &performance_cb, NULL); | 195 | atp = GNUNET_ATS_performance_init (cfg, &performance_cb, NULL); |
196 | if (atp == NULL) | 196 | if (atp == NULL) |