diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/common_logging.c | 2 | ||||
-rw-r--r-- | src/util/container_bloomfilter.c | 4 | ||||
-rw-r--r-- | src/util/container_heap.c | 4 | ||||
-rw-r--r-- | src/util/container_slist.c | 4 | ||||
-rw-r--r-- | src/util/disk.c | 20 | ||||
-rw-r--r-- | src/util/os_priority.c | 4 | ||||
-rw-r--r-- | src/util/peer.c | 2 | ||||
-rw-r--r-- | src/util/server_tc.c | 2 | ||||
-rw-r--r-- | src/util/signal.c | 2 | ||||
-rw-r--r-- | src/util/test_client.c | 2 | ||||
-rw-r--r-- | src/util/test_container_slist.c | 2 |
11 files changed, 24 insertions, 24 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 582435651..a2338f1c9 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -710,7 +710,7 @@ GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls) | |||
710 | { | 710 | { |
711 | struct CustomLogger *entry; | 711 | struct CustomLogger *entry; |
712 | 712 | ||
713 | entry = GNUNET_malloc (sizeof (struct CustomLogger)); | 713 | entry = GNUNET_new (struct CustomLogger); |
714 | entry->logger = logger; | 714 | entry->logger = logger; |
715 | entry->logger_cls = logger_cls; | 715 | entry->logger_cls = logger_cls; |
716 | entry->next = loggers; | 716 | entry->next = loggers; |
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c index 645729553..9554e0ec0 100644 --- a/src/util/container_bloomfilter.c +++ b/src/util/container_bloomfilter.c | |||
@@ -494,7 +494,7 @@ GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size, | |||
494 | ui *= 2; | 494 | ui *= 2; |
495 | size = ui; /* make sure it's a power of 2 */ | 495 | size = ui; /* make sure it's a power of 2 */ |
496 | 496 | ||
497 | bf = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_BloomFilter)); | 497 | bf = GNUNET_new (struct GNUNET_CONTAINER_BloomFilter); |
498 | /* Try to open a bloomfilter file */ | 498 | /* Try to open a bloomfilter file */ |
499 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) | 499 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) |
500 | bf->fh = | 500 | bf->fh = |
@@ -631,7 +631,7 @@ GNUNET_CONTAINER_bloomfilter_init (const char *data, size_t size, | |||
631 | 631 | ||
632 | if ((0 == k) || (0 == size)) | 632 | if ((0 == k) || (0 == size)) |
633 | return NULL; | 633 | return NULL; |
634 | bf = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_BloomFilter)); | 634 | bf = GNUNET_new (struct GNUNET_CONTAINER_BloomFilter); |
635 | bf->filename = NULL; | 635 | bf->filename = NULL; |
636 | bf->fh = NULL; | 636 | bf->fh = NULL; |
637 | bf->bitArray = GNUNET_malloc_large (size); | 637 | bf->bitArray = GNUNET_malloc_large (size); |
diff --git a/src/util/container_heap.c b/src/util/container_heap.c index 0f63f957d..54da89f7a 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c | |||
@@ -142,7 +142,7 @@ GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order) | |||
142 | { | 142 | { |
143 | struct GNUNET_CONTAINER_Heap *heap; | 143 | struct GNUNET_CONTAINER_Heap *heap; |
144 | 144 | ||
145 | heap = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_Heap)); | 145 | heap = GNUNET_new (struct GNUNET_CONTAINER_Heap); |
146 | heap->order = order; | 146 | heap->order = order; |
147 | return heap; | 147 | return heap; |
148 | } | 148 | } |
@@ -351,7 +351,7 @@ GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, void *element, | |||
351 | { | 351 | { |
352 | struct GNUNET_CONTAINER_HeapNode *node; | 352 | struct GNUNET_CONTAINER_HeapNode *node; |
353 | 353 | ||
354 | node = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_HeapNode)); | 354 | node = GNUNET_new (struct GNUNET_CONTAINER_HeapNode); |
355 | node->heap = heap; | 355 | node->heap = heap; |
356 | node->element = element; | 356 | node->element = element; |
357 | node->cost = cost; | 357 | node->cost = cost; |
diff --git a/src/util/container_slist.c b/src/util/container_slist.c index 10af916c3..e75c695c5 100644 --- a/src/util/container_slist.c +++ b/src/util/container_slist.c | |||
@@ -101,7 +101,7 @@ create_elem (enum GNUNET_CONTAINER_SListDisposition disp, const void *buf, | |||
101 | } | 101 | } |
102 | else | 102 | else |
103 | { | 103 | { |
104 | e = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_SList_Elem)); | 104 | e = GNUNET_new (struct GNUNET_CONTAINER_SList_Elem); |
105 | e->elem = (void *) buf; | 105 | e->elem = (void *) buf; |
106 | } | 106 | } |
107 | e->disp = disp; | 107 | e->disp = disp; |
@@ -190,7 +190,7 @@ GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, | |||
190 | struct GNUNET_CONTAINER_SList * | 190 | struct GNUNET_CONTAINER_SList * |
191 | GNUNET_CONTAINER_slist_create () | 191 | GNUNET_CONTAINER_slist_create () |
192 | { | 192 | { |
193 | return GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_SList)); | 193 | return GNUNET_new (struct GNUNET_CONTAINER_SList); |
194 | } | 194 | } |
195 | 195 | ||
196 | 196 | ||
diff --git a/src/util/disk.c b/src/util/disk.c index 074355c0a..aac730eec 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -1899,8 +1899,8 @@ GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh) | |||
1899 | * otherwise we're screwed, as selecting on non-overlapped handle | 1899 | * otherwise we're screwed, as selecting on non-overlapped handle |
1900 | * will block. | 1900 | * will block. |
1901 | */ | 1901 | */ |
1902 | fh->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 1902 | fh->oOverlapRead = GNUNET_new (OVERLAPPED); |
1903 | fh->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 1903 | fh->oOverlapWrite = GNUNET_new (OVERLAPPED); |
1904 | fh->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 1904 | fh->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
1905 | fh->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 1905 | fh->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
1906 | } | 1906 | } |
@@ -2356,10 +2356,10 @@ GNUNET_DISK_pipe (int blocking_read, int blocking_write, int inherit_read, int i | |||
2356 | p->fd[0]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; | 2356 | p->fd[0]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; |
2357 | p->fd[1]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; | 2357 | p->fd[1]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; |
2358 | 2358 | ||
2359 | p->fd[0]->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 2359 | p->fd[0]->oOverlapRead = GNUNET_new (OVERLAPPED); |
2360 | p->fd[0]->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 2360 | p->fd[0]->oOverlapWrite = GNUNET_new (OVERLAPPED); |
2361 | p->fd[1]->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 2361 | p->fd[1]->oOverlapRead = GNUNET_new (OVERLAPPED); |
2362 | p->fd[1]->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 2362 | p->fd[1]->oOverlapWrite = GNUNET_new (OVERLAPPED); |
2363 | 2363 | ||
2364 | p->fd[0]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2364 | p->fd[0]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2365 | p->fd[0]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2365 | p->fd[0]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
@@ -2462,8 +2462,8 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) | |||
2462 | if (p->fd[0]->h != INVALID_HANDLE_VALUE) | 2462 | if (p->fd[0]->h != INVALID_HANDLE_VALUE) |
2463 | { | 2463 | { |
2464 | p->fd[0]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; | 2464 | p->fd[0]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; |
2465 | p->fd[0]->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 2465 | p->fd[0]->oOverlapRead = GNUNET_new (OVERLAPPED); |
2466 | p->fd[0]->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 2466 | p->fd[0]->oOverlapWrite = GNUNET_new (OVERLAPPED); |
2467 | p->fd[0]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2467 | p->fd[0]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2468 | p->fd[0]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2468 | p->fd[0]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2469 | } | 2469 | } |
@@ -2480,8 +2480,8 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) | |||
2480 | if (p->fd[1]->h != INVALID_HANDLE_VALUE) | 2480 | if (p->fd[1]->h != INVALID_HANDLE_VALUE) |
2481 | { | 2481 | { |
2482 | p->fd[1]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; | 2482 | p->fd[1]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; |
2483 | p->fd[1]->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 2483 | p->fd[1]->oOverlapRead = GNUNET_new (OVERLAPPED); |
2484 | p->fd[1]->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 2484 | p->fd[1]->oOverlapWrite = GNUNET_new (OVERLAPPED); |
2485 | p->fd[1]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2485 | p->fd[1]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2486 | p->fd[1]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2486 | p->fd[1]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2487 | } | 2487 | } |
diff --git a/src/util/os_priority.c b/src/util/os_priority.c index ab82b7b58..2cabd214e 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c | |||
@@ -1089,7 +1089,7 @@ start_process (int pipe_control, | |||
1089 | return NULL; | 1089 | return NULL; |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process)); | 1092 | gnunet_proc = GNUNET_new (struct GNUNET_OS_Process); |
1093 | gnunet_proc->pid = proc.dwProcessId; | 1093 | gnunet_proc->pid = proc.dwProcessId; |
1094 | gnunet_proc->handle = proc.hProcess; | 1094 | gnunet_proc->handle = proc.hProcess; |
1095 | gnunet_proc->control_pipe = childpipe_write; | 1095 | gnunet_proc->control_pipe = childpipe_write; |
@@ -1774,7 +1774,7 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, | |||
1774 | return NULL; | 1774 | return NULL; |
1775 | } | 1775 | } |
1776 | GNUNET_DISK_pipe_close_end (opipe, GNUNET_DISK_PIPE_END_WRITE); | 1776 | GNUNET_DISK_pipe_close_end (opipe, GNUNET_DISK_PIPE_END_WRITE); |
1777 | cmd = GNUNET_malloc (sizeof (struct GNUNET_OS_CommandHandle)); | 1777 | cmd = GNUNET_new (struct GNUNET_OS_CommandHandle); |
1778 | cmd->timeout = GNUNET_TIME_relative_to_absolute (timeout); | 1778 | cmd->timeout = GNUNET_TIME_relative_to_absolute (timeout); |
1779 | cmd->eip = eip; | 1779 | cmd->eip = eip; |
1780 | cmd->opipe = opipe; | 1780 | cmd->opipe = opipe; |
diff --git a/src/util/peer.c b/src/util/peer.c index fa376d333..3e4e1712d 100644 --- a/src/util/peer.c +++ b/src/util/peer.c | |||
@@ -127,7 +127,7 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid) | |||
127 | GNUNET_array_grow (table, size, size + 16); | 127 | GNUNET_array_grow (table, size, size + 16); |
128 | for (i = ret; i < size; i++) | 128 | for (i = ret; i < size; i++) |
129 | { | 129 | { |
130 | table[i] = GNUNET_malloc (sizeof (struct PeerEntry)); | 130 | table[i] = GNUNET_new (struct PeerEntry); |
131 | table[i]->pid = i + 1; | 131 | table[i]->pid = i + 1; |
132 | } | 132 | } |
133 | } | 133 | } |
diff --git a/src/util/server_tc.c b/src/util/server_tc.c index 780b5f003..5324a6ab9 100644 --- a/src/util/server_tc.c +++ b/src/util/server_tc.c | |||
@@ -127,7 +127,7 @@ GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client *client) | |||
127 | struct GNUNET_SERVER_TransmitContext *tc; | 127 | struct GNUNET_SERVER_TransmitContext *tc; |
128 | 128 | ||
129 | GNUNET_assert (NULL != client); | 129 | GNUNET_assert (NULL != client); |
130 | tc = GNUNET_malloc (sizeof (struct GNUNET_SERVER_TransmitContext)); | 130 | tc = GNUNET_new (struct GNUNET_SERVER_TransmitContext); |
131 | GNUNET_SERVER_client_keep (client); | 131 | GNUNET_SERVER_client_keep (client); |
132 | tc->client = client; | 132 | tc->client = client; |
133 | return tc; | 133 | return tc; |
diff --git a/src/util/signal.c b/src/util/signal.c index 5cf50e8dc..b76c658c8 100644 --- a/src/util/signal.c +++ b/src/util/signal.c | |||
@@ -64,7 +64,7 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler) | |||
64 | struct sigaction sig; | 64 | struct sigaction sig; |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | ret = GNUNET_malloc (sizeof (struct GNUNET_SIGNAL_Context)); | 67 | ret = GNUNET_new (struct GNUNET_SIGNAL_Context); |
68 | ret->sig = signum; | 68 | ret->sig = signum; |
69 | ret->method = handler; | 69 | ret->method = handler; |
70 | #ifndef MINGW | 70 | #ifndef MINGW |
diff --git a/src/util/test_client.c b/src/util/test_client.c index 6dfb8349a..2b44c1690 100644 --- a/src/util/test_client.c +++ b/src/util/test_client.c | |||
@@ -73,7 +73,7 @@ echo_cb (void *cls, struct GNUNET_SERVER_Client *client, | |||
73 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 73 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
74 | "Receiving message from client, bouncing back\n"); | 74 | "Receiving message from client, bouncing back\n"); |
75 | GNUNET_assert (sizeof (struct GNUNET_MessageHeader) == ntohs (message->size)); | 75 | GNUNET_assert (sizeof (struct GNUNET_MessageHeader) == ntohs (message->size)); |
76 | cc = GNUNET_malloc (sizeof (struct CopyContext)); | 76 | cc = GNUNET_new (struct CopyContext); |
77 | cc->client = client; | 77 | cc->client = client; |
78 | cpy = GNUNET_malloc (ntohs (message->size)); | 78 | cpy = GNUNET_malloc (ntohs (message->size)); |
79 | memcpy (cpy, message, ntohs (message->size)); | 79 | memcpy (cpy, message, ntohs (message->size)); |
diff --git a/src/util/test_container_slist.c b/src/util/test_container_slist.c index 8b4ff93d0..443d5c7c5 100644 --- a/src/util/test_container_slist.c +++ b/src/util/test_container_slist.c | |||
@@ -136,7 +136,7 @@ main (int argc, char *argv[]) | |||
136 | 136 | ||
137 | for (i = 0; i < 100; i++) | 137 | for (i = 0; i < 100; i++) |
138 | { | 138 | { |
139 | ip = GNUNET_malloc (sizeof (int)); | 139 | ip = GNUNET_new (int); |
140 | *ip = i; | 140 | *ip = i; |
141 | GNUNET_CONTAINER_slist_add (l, GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC, | 141 | GNUNET_CONTAINER_slist_add (l, GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC, |
142 | ip, sizeof (int)); | 142 | ip, sizeof (int)); |