Browse Source

src: add character in front of macros STARPU_MALLOC, STARPU_CALLOC and STARPU_REALLOC

Nathalie Furmento 9 years ago
parent
commit
ea326f4d15
87 changed files with 346 additions and 346 deletions
  1. 4 4
      src/common/bitmap.c
  2. 3 3
      src/common/graph.c
  3. 2 2
      src/common/list.h
  4. 1 1
      src/common/prio_list.h
  5. 2 2
      src/common/thread.c
  6. 1 1
      src/common/utils.c
  7. 4 4
      src/common/utils.h
  8. 1 1
      src/core/combined_workers.c
  9. 1 1
      src/core/debug.c
  10. 1 1
      src/core/dependencies/cg.c
  11. 4 4
      src/core/dependencies/data_arbiter_concurrency.c
  12. 2 2
      src/core/dependencies/implicit_data_deps.c
  13. 4 4
      src/core/dependencies/tags.c
  14. 1 1
      src/core/dependencies/task_deps.c
  15. 4 4
      src/core/detect_combined_workers.c
  16. 3 3
      src/core/disk.c
  17. 8 8
      src/core/disk_ops/disk_leveldb.cpp
  18. 3 3
      src/core/disk_ops/disk_stdio.c
  19. 2 2
      src/core/disk_ops/disk_unistd.c
  20. 2 2
      src/core/disk_ops/disk_unistd_o_direct.c
  21. 4 4
      src/core/disk_ops/unistd/disk_unistd_global.c
  22. 4 4
      src/core/jobs.c
  23. 1 1
      src/core/parallel_task.c
  24. 5 5
      src/core/perfmodel/multiple_regression.c
  25. 4 4
      src/core/perfmodel/perfmodel.c
  26. 7 7
      src/core/perfmodel/perfmodel_bus.c
  27. 29 29
      src/core/perfmodel/perfmodel_history.c
  28. 4 4
      src/core/perfmodel/perfmodel_print.c
  29. 2 2
      src/core/perfmodel/regression.c
  30. 6 6
      src/core/sched_ctx.c
  31. 3 3
      src/core/sched_ctx_list.c
  32. 6 6
      src/core/simgrid.c
  33. 3 3
      src/core/task.c
  34. 4 4
      src/core/task_bundle.c
  35. 9 9
      src/core/topology.c
  36. 1 1
      src/core/tree.c
  37. 4 4
      src/core/workers.c
  38. 1 1
      src/datawizard/coherency.c
  39. 1 1
      src/datawizard/data_request.c
  40. 4 4
      src/datawizard/filters.c
  41. 5 5
      src/datawizard/interfaces/data_interface.c
  42. 1 1
      src/datawizard/interfaces/multiformat_interface.c
  43. 1 1
      src/datawizard/malloc.c
  44. 1 1
      src/datawizard/memstats.c
  45. 1 1
      src/datawizard/reduction.c
  46. 2 2
      src/datawizard/user_interactions.c
  47. 2 2
      src/debug/traces/anim.c
  48. 8 8
      src/debug/traces/starpu_fxt.c
  49. 2 2
      src/debug/traces/starpu_fxt_mpi.c
  50. 2 2
      src/drivers/mic/driver_mic_sink.c
  51. 4 4
      src/drivers/mp_common/mp_common.c
  52. 7 7
      src/drivers/mp_common/sink_common.c
  53. 3 3
      src/drivers/mp_common/source_common.c
  54. 11 11
      src/drivers/opencl/driver_opencl_utils.c
  55. 7 7
      src/profiling/bound.c
  56. 1 1
      src/profiling/profiling.c
  57. 2 2
      src/sched_policies/component_composed.c
  58. 1 1
      src/sched_policies/component_fifo.c
  59. 1 1
      src/sched_policies/component_heft.c
  60. 1 1
      src/sched_policies/component_perfmodel_select.c
  61. 1 1
      src/sched_policies/component_prio.c
  62. 4 4
      src/sched_policies/component_sched.c
  63. 5 5
      src/sched_policies/component_work_stealing.c
  64. 4 4
      src/sched_policies/component_worker.c
  65. 4 4
      src/sched_policies/deque_modeling_policy_data_aware.c
  66. 1 1
      src/sched_policies/eager_central_policy.c
  67. 4 4
      src/sched_policies/eager_central_priority_policy.c
  68. 1 1
      src/sched_policies/fifo_queues.c
  69. 1 1
      src/sched_policies/graph_test_policy.c
  70. 1 1
      src/sched_policies/helper_mct.c
  71. 1 1
      src/sched_policies/heteroprio.c
  72. 1 1
      src/sched_policies/parallel_eager.c
  73. 1 1
      src/sched_policies/parallel_heft.c
  74. 1 1
      src/sched_policies/prio_deque.c
  75. 1 1
      src/sched_policies/scheduler_maker.c
  76. 4 4
      src/sched_policies/work_stealing_policy.c
  77. 33 33
      src/top/starpu_top.c
  78. 1 1
      src/top/starpu_top_message_queue.c
  79. 3 3
      src/top/starpu_top_task.c
  80. 5 5
      src/util/fstarpu.c
  81. 22 22
      src/util/openmp_runtime_support.c
  82. 8 8
      src/util/openmp_runtime_support_environment.c
  83. 11 11
      src/util/starpu_clusters_create.c
  84. 1 1
      src/util/starpu_data_cpy.c
  85. 5 5
      src/util/starpu_task_insert_utils.c
  86. 3 3
      src/worker_collection/worker_list.c
  87. 1 1
      src/worker_collection/worker_tree.c

+ 4 - 4
src/common/bitmap.c

@@ -75,7 +75,7 @@ static int _count_bit(unsigned long e)
 struct starpu_bitmap * starpu_bitmap_create(void)
 {
 	struct starpu_bitmap *b;
-	STARPU_CALLOC(b, 1, sizeof(*b));
+	_STARPU_CALLOC(b, 1, sizeof(*b));
 	return b;
 }
 void starpu_bitmap_destroy(struct starpu_bitmap * b)
@@ -96,7 +96,7 @@ void starpu_bitmap_set(struct starpu_bitmap * b, int e)
 		return;
 	if((e/LONG_BIT) + 1 > b->size)
 	{
-		STARPU_REALLOC(b->bits, sizeof(unsigned long) * ((e/LONG_BIT) + 1));
+		_STARPU_REALLOC(b->bits, sizeof(unsigned long) * ((e/LONG_BIT) + 1));
 		memset(b->bits + b->size, 0, sizeof(unsigned long) * ((e/LONG_BIT + 1) - b->size));
 		b->size = (e/LONG_BIT) + 1;
 	}
@@ -125,7 +125,7 @@ void starpu_bitmap_unset_all(struct starpu_bitmap * b)
 void starpu_bitmap_unset_and(struct starpu_bitmap * a, struct starpu_bitmap * b, struct starpu_bitmap * c)
 {
 	int n = STARPU_MIN(b->size, c->size);
-	STARPU_REALLOC(a->bits, sizeof(unsigned long) * n);
+	_STARPU_REALLOC(a->bits, sizeof(unsigned long) * n);
 	a->size = n;
 	a->cardinal = 0;
 	int i;
@@ -149,7 +149,7 @@ void starpu_bitmap_or(struct starpu_bitmap * a, struct starpu_bitmap * b)
 {
 	if(a->size < b->size)
 	{
-		STARPU_REALLOC(a->bits, b->size * sizeof(unsigned long));
+		_STARPU_REALLOC(a->bits, b->size * sizeof(unsigned long));
 		memset(a->bits + a->size, 0, (b->size - a->size) * sizeof(unsigned long));
 		a->size = b->size;
 

+ 3 - 3
src/common/graph.c

@@ -113,7 +113,7 @@ static void __starpu_graph_foreach(void (*func)(void *data, struct _starpu_graph
 void _starpu_graph_add_job(struct _starpu_job *job)
 {
 	struct _starpu_graph_node *node;
-	STARPU_CALLOC(node, 1, sizeof(*node));
+	_STARPU_CALLOC(node, 1, sizeof(*node));
 	node->job = job;
 	job->graph_node = node;
 	STARPU_PTHREAD_MUTEX_INIT(&node->mutex, NULL);
@@ -138,10 +138,10 @@ static unsigned add_node(struct _starpu_graph_node *node, struct _starpu_graph_n
 			*alloc_nodes *= 2;
 		else
 			*alloc_nodes = 4;
-		STARPU_REALLOC(*nodes, *alloc_nodes * sizeof(**nodes));
+		_STARPU_REALLOC(*nodes, *alloc_nodes * sizeof(**nodes));
 		if (slot)
 		{
-			STARPU_REALLOC(*slot, *alloc_nodes * sizeof(**slot));
+			_STARPU_REALLOC(*slot, *alloc_nodes * sizeof(**slot));
 		}
 	}
 	ret = (*n_nodes)++;

+ 2 - 2
src/common/list.h

@@ -135,7 +135,7 @@
     struct ENAME *_tail; /**< @internal tail of the list */ \
   }; \
   /** @internal */static inline struct ENAME *ENAME##_new(void) \
-    { struct ENAME *e; STARPU_MALLOC(e, sizeof(struct ENAME)); \
+    { struct ENAME *e; _STARPU_MALLOC(e, sizeof(struct ENAME)); \
       e->_next = NULL; e->_prev = NULL; return e; } \
   /** @internal */static inline void ENAME##_delete(struct ENAME *e) \
     { free(e); } \
@@ -164,7 +164,7 @@
   /** @internal */static inline void ENAME##_list_init(struct ENAME##_list *l) \
     { l->_head=NULL; l->_tail=l->_head; } \
   /** @internal */static inline struct ENAME##_list *ENAME##_list_new(void) \
-    { struct ENAME##_list *l; STARPU_MALLOC(l, sizeof(struct ENAME##_list)); \
+    { struct ENAME##_list *l; _STARPU_MALLOC(l, sizeof(struct ENAME##_list)); \
       ENAME##_list_init(l); return l; } \
   /** @internal */static inline int ENAME##_list_empty(const struct ENAME##_list *l) \
     { return (l->_head == NULL); } \

+ 1 - 1
src/common/prio_list.h

@@ -112,7 +112,7 @@
 		if (node) \
 			stage = ENAME##_node_to_list_stage(node); \
 		else { \
-			STARPU_MALLOC(stage, sizeof(*stage));	\
+			_STARPU_MALLOC(stage, sizeof(*stage));	\
 			starpu_rbtree_node_init(&stage->node); \
 			stage->prio = prio; \
 			_starpu_data_request_list_init(&stage->list); \

+ 2 - 2
src/common/thread.c

@@ -47,7 +47,7 @@ extern int _starpu_simgrid_thread_start(int argc, char *argv[]);
 int starpu_pthread_create_on(char *name, starpu_pthread_t *thread, const starpu_pthread_attr_t *attr STARPU_ATTRIBUTE_UNUSED, void *(*start_routine) (void *), void *arg, msg_host_t host)
 {
 	char **_args;
-	STARPU_MALLOC(_args, 3*sizeof(char*));
+	_STARPU_MALLOC(_args, 3*sizeof(char*));
 	asprintf(&_args[0], "%p", start_routine);
 	asprintf(&_args[1], "%p", arg);
 	_args[2] = NULL;
@@ -407,7 +407,7 @@ int starpu_pthread_queue_register(starpu_pthread_wait_t *w, starpu_pthread_queue
 		newalloc = q->allocqueue * 2;
 		if (!newalloc)
 			newalloc = 1;
-		STARPU_REALLOC(q->queue, newalloc * sizeof(*(q->queue)));
+		_STARPU_REALLOC(q->queue, newalloc * sizeof(*(q->queue)));
 		q->allocqueue = newalloc;
 	}
 	q->queue[q->nqueue++] = w;

+ 1 - 1
src/common/utils.c

@@ -145,7 +145,7 @@ char *_starpu_mktemp(const char *directory, int flags, int *fd)
 	/* create template for mkstemp */
 	const char *tmp = "STARPU_XXXXXX";
 	char *baseCpy;
-	STARPU_MALLOC(baseCpy, strlen(directory)+1+strlen(tmp)+1);
+	_STARPU_MALLOC(baseCpy, strlen(directory)+1+strlen(tmp)+1);
 	STARPU_ASSERT(baseCpy != NULL);
 
 	strcpy(baseCpy, directory);

+ 4 - 4
src/common/utils.h

@@ -116,10 +116,10 @@
 	} while (0)
 
 
-#define STARPU_MALLOC(ptr, size) do { ptr = malloc(size); STARPU_ASSERT_MSG(ptr != NULL, "Cannot allocate %ld bytes\n", size); } while (0)
-#define STARPU_CALLOC(ptr, nmemb, size) do { ptr = calloc(nmemb, size); STARPU_ASSERT_MSG(ptr != NULL, "Cannot allocate %ld bytes\n", nmemb*size); } while (0)
-#define STARPU_REALLOC(ptr, size) do { ptr = realloc(ptr, size); STARPU_ASSERT_MSG(ptr != NULL, "Cannot reallocate %ld bytes\n", size); } while (0)
-#define STARPU_FREE(ptr) do { free(ptr); ptr = NULL; } while(0)
+#define _STARPU_MALLOC(ptr, size) do { ptr = malloc(size); STARPU_ASSERT_MSG(ptr != NULL, "Cannot allocate %ld bytes\n", size); } while (0)
+#define _STARPU_CALLOC(ptr, nmemb, size) do { ptr = calloc(nmemb, size); STARPU_ASSERT_MSG(ptr != NULL, "Cannot allocate %ld bytes\n", nmemb*size); } while (0)
+#define _STARPU_REALLOC(ptr, size) do { ptr = realloc(ptr, size); STARPU_ASSERT_MSG(ptr != NULL, "Cannot reallocate %ld bytes\n", size); } while (0)
+#define _STARPU_FREE(ptr) do { free(ptr); ptr = NULL; } while(0)
 
 #ifdef _MSC_VER
 #define _STARPU_IS_ZERO(a) (a == 0.0)

+ 1 - 1
src/core/combined_workers.c

@@ -102,7 +102,7 @@ int starpu_combined_worker_assign_workerid(int nworkers, int workerid_array[])
 		&config->combined_workers[combined_worker_id];
 
 	combined_worker->worker_size = nworkers;
-	STARPU_MALLOC(combined_worker->perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+	_STARPU_MALLOC(combined_worker->perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 	combined_worker->perf_arch.ndevices = 1;
 	combined_worker->perf_arch.devices[0].type = config->workers[workerid_array[0]].perf_arch.devices[0].type;
 	combined_worker->perf_arch.devices[0].devid = config->workers[workerid_array[0]].perf_arch.devices[0].devid;

+ 1 - 1
src/core/debug.c

@@ -106,7 +106,7 @@ int64_t _starpu_ayudame_get_func_id(struct starpu_codelet *cl)
 			ncodelets_alloc = 16;
 		else
 			ncodelets_alloc *= 2;
-		STARPU_REALLOC(codelets, ncodelets_alloc * sizeof(*codelets));
+		_STARPU_REALLOC(codelets, ncodelets_alloc * sizeof(*codelets));
 	}
 	codelets[ncodelets].cl = cl;
 	if (name)

+ 1 - 1
src/core/dependencies/cg.c

@@ -82,7 +82,7 @@ int _starpu_add_successor_to_cg_list(struct _starpu_cg_list *successors, struct
 		else
 			successors->succ_list_size = 4;
 
-		STARPU_REALLOC(successors->succ, successors->succ_list_size*sizeof(struct _starpu_cg *));
+		_STARPU_REALLOC(successors->succ, successors->succ_list_size*sizeof(struct _starpu_cg *));
 	}
 #else
 	STARPU_ASSERT(index < STARPU_NMAXDEPS);

+ 4 - 4
src/core/dependencies/data_arbiter_concurrency.c

@@ -130,7 +130,7 @@ static int _starpu_LockOrDelegatePostOrPerform(starpu_arbiter_t arbiter, void (*
 	struct LockOrDelegateListNode *newNode, *iter, *next;
 	int did = 0;
 
-	STARPU_MALLOC(newNode, sizeof(*newNode));
+	_STARPU_MALLOC(newNode, sizeof(*newNode));
 	newNode->data = data;
 	newNode->func = func;
 
@@ -228,7 +228,7 @@ unsigned _starpu_attempt_to_submit_arbitered_data_request(unsigned request_from_
 						       struct _starpu_job *j, unsigned buffer_index)
 {
 	struct starpu_submit_arbitered_args* args;
-	STARPU_MALLOC(args, sizeof(*args));
+	_STARPU_MALLOC(args, sizeof(*args));
 	args->request_from_codelet = request_from_codelet;
 	args->handle = handle;
 	args->mode = mode;
@@ -364,7 +364,7 @@ static void __starpu_submit_job_enforce_arbitered_deps(void* inData)
 void _starpu_submit_job_enforce_arbitered_deps(struct _starpu_job *j, unsigned buf, unsigned nbuffers)
 {
 	struct starpu_enforce_arbitered_args* args;
-	STARPU_MALLOC(args, sizeof(*args));
+	_STARPU_MALLOC(args, sizeof(*args));
 	starpu_data_handle_t handle = _STARPU_JOB_GET_ORDERED_BUFFER_HANDLE(j, buf);
 	args->j = j;
 	args->buf = buf;
@@ -669,7 +669,7 @@ void _starpu_notify_arbitered_dependencies(starpu_data_handle_t handle)
 starpu_arbiter_t starpu_arbiter_create(void)
 {
 	starpu_arbiter_t res;
-	STARPU_MALLOC(res, sizeof(*res));
+	_STARPU_MALLOC(res, sizeof(*res));
 
 #ifdef LOCK_OR_DELEGATE
 	res->dlTaskListHead = NULL;

+ 2 - 2
src/core/dependencies/implicit_data_deps.c

@@ -435,7 +435,7 @@ void _starpu_release_data_enforce_sequential_consistency(struct starpu_task *tas
 				/* Save the job id of the reader task in the ghost reader linked list list */
 				struct _starpu_job *ghost_reader_job = _starpu_get_job_associated_to_task(task);
 				struct _starpu_jobid_list *link;
-				STARPU_MALLOC(link, sizeof(struct _starpu_jobid_list));
+				_STARPU_MALLOC(link, sizeof(struct _starpu_jobid_list));
 				link->next = handle->last_submitted_ghost_accessors_id;
 				link->id = ghost_reader_job->job_id;
 				handle->last_submitted_ghost_accessors_id = link;
@@ -499,7 +499,7 @@ void _starpu_add_post_sync_tasks(struct starpu_task *post_sync_task, starpu_data
 		handle->post_sync_tasks_cnt++;
 
 		struct _starpu_task_wrapper_list *link;
-		STARPU_MALLOC(link, sizeof(struct _starpu_task_wrapper_list));
+		_STARPU_MALLOC(link, sizeof(struct _starpu_task_wrapper_list));
 		link->task = post_sync_task;
 		link->next = handle->post_sync_tasks;
 		handle->post_sync_tasks = link;

+ 4 - 4
src/core/dependencies/tags.c

@@ -45,7 +45,7 @@ static starpu_pthread_rwlock_t tag_global_rwlock;
 static struct _starpu_cg *create_cg_apps(unsigned ntags)
 {
 	struct _starpu_cg *cg;
-	STARPU_MALLOC(cg, sizeof(struct _starpu_cg));
+	_STARPU_MALLOC(cg, sizeof(struct _starpu_cg));
 
 	cg->ntags = ntags;
 	cg->remaining = ntags;
@@ -61,7 +61,7 @@ static struct _starpu_cg *create_cg_apps(unsigned ntags)
 static struct _starpu_cg *create_cg_tag(unsigned ntags, struct _starpu_tag *tag)
 {
 	struct _starpu_cg *cg;
-	STARPU_MALLOC(cg, sizeof(struct _starpu_cg));
+	_STARPU_MALLOC(cg, sizeof(struct _starpu_cg));
 
 	cg->ntags = ntags;
 	cg->remaining = ntags;
@@ -76,7 +76,7 @@ static struct _starpu_cg *create_cg_tag(unsigned ntags, struct _starpu_tag *tag)
 static struct _starpu_tag *_starpu_tag_init(starpu_tag_t id)
 {
 	struct _starpu_tag *tag;
-	STARPU_MALLOC(tag, sizeof(struct _starpu_tag));
+	_STARPU_MALLOC(tag, sizeof(struct _starpu_tag));
 
 	tag->job = NULL;
 	tag->is_assigned = 0;
@@ -190,7 +190,7 @@ static struct _starpu_tag *_gettag_struct(starpu_tag_t id)
 		tag = _starpu_tag_init(id);
 
 		struct _starpu_tag_table *entry2;
-		STARPU_MALLOC(entry2, sizeof(*entry2));
+		_STARPU_MALLOC(entry2, sizeof(*entry2));
 		entry2->id = id;
 		entry2->tag = tag;
 

+ 1 - 1
src/core/dependencies/task_deps.c

@@ -31,7 +31,7 @@
 static struct _starpu_cg *create_cg_task(unsigned ntags, struct _starpu_job *j)
 {
 	struct _starpu_cg *cg;
-	STARPU_MALLOC(cg, sizeof(struct _starpu_cg));
+	_STARPU_MALLOC(cg, sizeof(struct _starpu_cg));
 
 	cg->ntags = ntags;
 	cg->remaining = ntags;

+ 4 - 4
src/core/detect_combined_workers.c

@@ -254,14 +254,14 @@ static void find_and_assign_combinations_without_hwloc(int *workerids, int nwork
 	unsigned * nmics_table;
 	int * mic_id;
 	int ** mic_workers;
-	STARPU_MALLOC(mic_id, sizeof(int)*nb_mics);
-	STARPU_MALLOC(nmics_table, sizeof(unsigned)*nb_mics);
-	STARPU_MALLOC(mic_workers, sizeof(int*)*nb_mics);
+	_STARPU_MALLOC(mic_id, sizeof(int)*nb_mics);
+	_STARPU_MALLOC(nmics_table, sizeof(unsigned)*nb_mics);
+	_STARPU_MALLOC(mic_workers, sizeof(int*)*nb_mics);
 	for(j=0; j<nb_mics; j++)
 	{
 		mic_id[j] = -1;
 		nmics_table[j] = 0;
-		STARPU_MALLOC(mic_workers[j], sizeof(int)*STARPU_NMAXWORKERS);
+		_STARPU_MALLOC(mic_workers[j], sizeof(int)*STARPU_NMAXWORKERS);
 	}
 #endif /* STARPU_USE_MIC */
 

+ 3 - 3
src/core/disk.c

@@ -276,17 +276,17 @@ static void add_disk_in_list(unsigned node,  struct starpu_disk_ops *func, void
 	/* initialization */
 	if (disk_register_list == NULL)
 	{
-		STARPU_MALLOC(disk_register_list, size_register_list*sizeof(struct disk_register *));
+		_STARPU_MALLOC(disk_register_list, size_register_list*sizeof(struct disk_register *));
 	}
 	/* small size -> new size  */
 	if ((disk_number+1) > size_register_list)
 	{
 		size_register_list *= 2;
-		STARPU_REALLOC(disk_register_list, size_register_list*sizeof(struct disk_register *));
+		_STARPU_REALLOC(disk_register_list, size_register_list*sizeof(struct disk_register *));
 	}
 
 	struct disk_register *dr;
-	STARPU_MALLOC(dr, sizeof(struct disk_register));
+	_STARPU_MALLOC(dr, sizeof(struct disk_register));
 	dr->node = node;
 	dr->base = base;
 	dr->flag = STARPU_DISK_ALL;

+ 8 - 8
src/core/disk_ops/disk_leveldb.cpp

@@ -51,13 +51,13 @@ static void *starpu_leveldb_alloc(void *base, size_t size STARPU_ATTRIBUTE_UNUSE
 {
 	struct starpu_leveldb_base *base_tmp = (struct starpu_leveldb_base *) base;
 	struct starpu_leveldb_obj *obj;
-	STARPU_MALLOC(obj, sizeof(struct starpu_leveldb_obj));
+	_STARPU_MALLOC(obj, sizeof(struct starpu_leveldb_obj));
 
         STARPU_PTHREAD_MUTEX_INIT(&obj->mutex, NULL);
 
 	size_t len = 6 + 1 + 2+sizeof(void*)*2 + 1;
 	char *key;
-	STARPU_MALLOC(key, len*sizeof(char));
+	_STARPU_MALLOC(key, len*sizeof(char));
 	snprintf(key, len, "STARPU-%p", obj);
 
 	/* create and add a key with a small memory */
@@ -89,7 +89,7 @@ static void starpu_leveldb_free(void *base , void *obj, size_t size STARPU_ATTRI
 static void *starpu_leveldb_open(void *base STARPU_ATTRIBUTE_UNUSED, void *pos, size_t size)
 {
 	struct starpu_leveldb_obj *obj;
-	STARPU_MALLOC(obj, sizeof(struct starpu_leveldb_obj));
+	_STARPU_MALLOC(obj, sizeof(struct starpu_leveldb_obj));
 
         STARPU_PTHREAD_MUTEX_INIT(&obj->mutex, NULL);
 
@@ -149,7 +149,7 @@ static int starpu_leveldb_full_read(void *base, void *obj, void **ptr, size_t *s
 	STARPU_ASSERT(s.ok());
 
 	*size = value.length();
-	STARPU_MALLOC(*ptr, *size);
+	_STARPU_MALLOC(*ptr, *size);
 
 	/* use buffer */
 	memcpy(*ptr, value.c_str(), *size);
@@ -177,7 +177,7 @@ static int starpu_leveldb_write(void *base, void *obj, const void *buf, off_t of
 	else
 	{
 		uintptr_t buf_tmp = (uintptr_t) buf;
-		STARPU_MALLOC(buffer, (tmp->size > (offset + size)) ? tmp->size : (offset + size));
+		_STARPU_MALLOC(buffer, (tmp->size > (offset + size)) ? tmp->size : (offset + size));
 
 		/* we read the data */
 		std::string value;
@@ -225,7 +225,7 @@ static int starpu_leveldb_full_write(void *base, void *obj, void *ptr, size_t si
 static void *starpu_leveldb_plug(void *parameter, starpu_ssize_t size STARPU_ATTRIBUTE_UNUSED)
 {
 	struct starpu_leveldb_base *tmp;
-	STARPU_MALLOC(tmp, sizeof(struct starpu_leveldb_base));
+	_STARPU_MALLOC(tmp, sizeof(struct starpu_leveldb_base));
 
 	leveldb::Status status;
 	leveldb::DB *db;
@@ -269,7 +269,7 @@ static int get_leveldb_bandwidth_between_disk_and_main_ram(unsigned node)
 
 	srand(time (NULL));
 	char *buf;
-	STARPU_MALLOC(buf, SIZE_DISK_MIN*sizeof(char));
+	_STARPU_MALLOC(buf, SIZE_DISK_MIN*sizeof(char));
 
 	/* allocate memory */
 	void *mem = _starpu_disk_alloc(node, SIZE_DISK_MIN);
@@ -293,7 +293,7 @@ static int get_leveldb_bandwidth_between_disk_and_main_ram(unsigned node)
 	/* free memory */
 	free(buf);
 
-	STARPU_MALLOC(buf, sizeof(char));
+	_STARPU_MALLOC(buf, sizeof(char));
 
 	/* Measure latency */
 	start = starpu_timing_now();

+ 3 - 3
src/core/disk_ops/disk_stdio.c

@@ -58,7 +58,7 @@ struct starpu_stdio_obj
 static struct starpu_stdio_obj *_starpu_stdio_init(int descriptor, char *path, size_t size)
 {
 	struct starpu_stdio_obj *obj;
-	STARPU_MALLOC(obj, sizeof(struct starpu_stdio_obj));
+	_STARPU_MALLOC(obj, sizeof(struct starpu_stdio_obj));
 
 	FILE *f = fdopen(descriptor,"rb+");
 	if (f == NULL)
@@ -174,7 +174,7 @@ static void *starpu_stdio_open(void *base, void *pos, size_t size)
 	struct starpu_stdio_obj *obj;
 	/* create template */
 	char *baseCpy;
-	STARPU_MALLOC(baseCpy, strlen(base)+1+strlen(pos)+1);
+	_STARPU_MALLOC(baseCpy, strlen(base)+1+strlen(pos)+1);
 	strcpy(baseCpy,(char *) base);
 	strcat(baseCpy,(char *) "/");
 	strcat(baseCpy,(char *) pos);
@@ -320,7 +320,7 @@ static int starpu_stdio_full_write(void *base STARPU_ATTRIBUTE_UNUSED, void *obj
 static void *starpu_stdio_plug(void *parameter, starpu_ssize_t size STARPU_ATTRIBUTE_UNUSED)
 {
 	char *tmp;
-	STARPU_MALLOC(tmp, sizeof(char)*(strlen(parameter)+1));
+	_STARPU_MALLOC(tmp, sizeof(char)*(strlen(parameter)+1));
 	strcpy(tmp,(char *) parameter);
 
 	{

+ 2 - 2
src/core/disk_ops/disk_unistd.c

@@ -34,7 +34,7 @@
 static void *starpu_unistd_alloc(void *base, size_t size)
 {
         struct starpu_unistd_global_obj *obj;
-	STARPU_MALLOC(obj, sizeof(struct starpu_unistd_global_obj));
+	_STARPU_MALLOC(obj, sizeof(struct starpu_unistd_global_obj));
 	/* only flags change between unistd and unistd_o_direct */
 	obj->flags = O_RDWR | O_BINARY;
 	return starpu_unistd_global_alloc(obj, base, size);
@@ -44,7 +44,7 @@ static void *starpu_unistd_alloc(void *base, size_t size)
 static void *starpu_unistd_open(void *base, void *pos, size_t size)
 {
 	struct starpu_unistd_global_obj *obj;
-	STARPU_MALLOC(obj, sizeof(struct starpu_unistd_global_obj));
+	_STARPU_MALLOC(obj, sizeof(struct starpu_unistd_global_obj));
 	/* only flags change between unistd and unistd_o_direct */
 	obj->flags = O_RDWR | O_BINARY;
 	return starpu_unistd_global_open(obj, base, pos, size);

+ 2 - 2
src/core/disk_ops/disk_unistd_o_direct.c

@@ -34,7 +34,7 @@
 static void *starpu_unistd_o_direct_alloc(void *base, size_t size)
 {
         struct starpu_unistd_global_obj *obj;
-	STARPU_MALLOC(obj, sizeof(struct starpu_unistd_global_obj));
+	_STARPU_MALLOC(obj, sizeof(struct starpu_unistd_global_obj));
         /* only flags change between unistd and unistd_o_direct */
         obj->flags = O_RDWR | O_DIRECT | O_BINARY;
         return starpu_unistd_global_alloc (obj, base, size);
@@ -44,7 +44,7 @@ static void *starpu_unistd_o_direct_alloc(void *base, size_t size)
 static void *starpu_unistd_o_direct_open(void *base, void *pos, size_t size)
 {
         struct starpu_unistd_global_obj *obj;
-	STARPU_MALLOC(obj, sizeof(struct starpu_unistd_global_obj));
+	_STARPU_MALLOC(obj, sizeof(struct starpu_unistd_global_obj));
         /* only flags change between unistd and unistd_o_direct */
         obj->flags = O_RDWR | O_DIRECT | O_BINARY;
         return starpu_unistd_global_open (obj, base, pos, size);

+ 4 - 4
src/core/disk_ops/unistd/disk_unistd_global.c

@@ -160,7 +160,7 @@ void *starpu_unistd_global_open(struct starpu_unistd_global_obj *obj, void *base
 {
 	/* create template */
 	char *baseCpy;
-	STARPU_MALLOC(baseCpy, strlen(base)+1+strlen(pos)+1);
+	_STARPU_MALLOC(baseCpy, strlen(base)+1+strlen(pos)+1);
 	strcpy(baseCpy,(char *) base);
 	strcat(baseCpy,(char *) "/");
 	strcat(baseCpy,(char *) pos);
@@ -227,7 +227,7 @@ void *starpu_unistd_global_async_read(void *base STARPU_ATTRIBUTE_UNUSED, void *
 {
         struct starpu_unistd_global_obj *tmp = obj;
         struct starpu_unistd_aiocb *starpu_aiocb;
-	STARPU_CALLOC(starpu_aiocb, 1,sizeof(*starpu_aiocb));
+	_STARPU_CALLOC(starpu_aiocb, 1,sizeof(*starpu_aiocb));
         struct aiocb *aiocb = &starpu_aiocb->aiocb;
         starpu_aiocb->obj = obj;
         int fd = tmp->descriptor;
@@ -317,7 +317,7 @@ void *starpu_unistd_global_async_write(void *base STARPU_ATTRIBUTE_UNUSED, void
 {
         struct starpu_unistd_global_obj *tmp = obj;
         struct starpu_unistd_aiocb *starpu_aiocb;
-	STARPU_CALLOC(starpu_aiocb, 1,sizeof(*starpu_aiocb));
+	_STARPU_CALLOC(starpu_aiocb, 1,sizeof(*starpu_aiocb));
         struct aiocb *aiocb = &starpu_aiocb->aiocb;
         starpu_aiocb->obj = obj;
         int fd = tmp->descriptor;
@@ -369,7 +369,7 @@ int starpu_unistd_global_full_write(void *base STARPU_ATTRIBUTE_UNUSED, void *ob
 void *starpu_unistd_global_plug(void *parameter, starpu_ssize_t size STARPU_ATTRIBUTE_UNUSED)
 {
 	char *tmp;
-	STARPU_MALLOC(tmp, sizeof(char)*(strlen(parameter)+1));
+	_STARPU_MALLOC(tmp, sizeof(char)*(strlen(parameter)+1));
 	strcpy(tmp,(char *) parameter);
 
 	{

+ 4 - 4
src/core/jobs.c

@@ -72,7 +72,7 @@ struct _starpu_job* STARPU_ATTRIBUTE_MALLOC _starpu_job_create(struct starpu_tas
 	struct _starpu_job *job;
         _STARPU_LOG_IN();
 
-	STARPU_MALLOC(job, sizeof(*job));
+	_STARPU_MALLOC(job, sizeof(*job));
 
 	/* As most of the fields must be initialized at NULL, let's put 0
 	 * everywhere */
@@ -80,8 +80,8 @@ struct _starpu_job* STARPU_ATTRIBUTE_MALLOC _starpu_job_create(struct starpu_tas
 
 	if (task->dyn_handles)
 	{
-		STARPU_MALLOC(job->dyn_ordered_buffers, STARPU_TASK_GET_NBUFFERS(task) * sizeof(job->dyn_ordered_buffers[0]));
-		STARPU_CALLOC(job->dyn_dep_slots, STARPU_TASK_GET_NBUFFERS(task), sizeof(job->dyn_dep_slots[0]));
+		_STARPU_MALLOC(job->dyn_ordered_buffers, STARPU_TASK_GET_NBUFFERS(task) * sizeof(job->dyn_ordered_buffers[0]));
+		_STARPU_CALLOC(job->dyn_dep_slots, STARPU_TASK_GET_NBUFFERS(task), sizeof(job->dyn_dep_slots[0]));
 	}
 
 	job->task = task;
@@ -727,7 +727,7 @@ int _starpu_push_local_task(struct _starpu_worker *worker, struct starpu_task *t
 				alloc = 1;
 			while (alloc < needed)
 				alloc *= 2;
-			STARPU_MALLOC(new, alloc * sizeof(*new));
+			_STARPU_MALLOC(new, alloc * sizeof(*new));
 
 			if (worker->local_ordered_tasks_size)
 			{

+ 1 - 1
src/core/parallel_task.c

@@ -25,7 +25,7 @@
 struct starpu_task *starpu_task_dup(struct starpu_task *task)
 {
 	struct starpu_task *task_dup;
-	STARPU_MALLOC(task_dup, sizeof(struct starpu_task));
+	_STARPU_MALLOC(task_dup, sizeof(struct starpu_task));
 
 	/* TODO perhaps this is a bit too much overhead and we should only copy
 	 * part of the structure ? */

+ 5 - 5
src/core/perfmodel/multiple_regression.c

@@ -191,9 +191,9 @@ int dgels_multiple_reg_coeff(double *mpar, double *my, long nn, unsigned ncoeff,
 	integer n = ncoeff;
 	integer nrhs = 1; // number of columns of B and X (wich are vectors therefore nrhs=1)
 	doublereal *X;
-	STARPU_MALLOC(X, sizeof(double)*n*m); // (/!\ modified at the output) contain the model and the different values of pararmters
+	_STARPU_MALLOC(X, sizeof(double)*n*m); // (/!\ modified at the output) contain the model and the different values of pararmters
 	doublereal *Y;
-	STARPU_MALLOC(Y, sizeof(double)*m);
+	_STARPU_MALLOC(Y, sizeof(double)*m);
 
 	double coefficient;
 	int i;
@@ -219,7 +219,7 @@ int dgels_multiple_reg_coeff(double *mpar, double *my, long nn, unsigned ncoeff,
 
 	integer lwork = n*2;
 	doublereal *work; // (output)
-	STARPU_MALLOC(work, sizeof(double)*lwork);
+	_STARPU_MALLOC(work, sizeof(double)*lwork);
 
 	/* // Running LAPACK dgels_ */
 	dgels_(&trans, &m, &n, &nrhs, X, &lda, Y, &ldb, work, &lwork, &info);
@@ -295,9 +295,9 @@ int _starpu_multiple_regression(struct starpu_perfmodel_history_list *ptr, doubl
 
 	/* Allocating X and Y matrices */
 	double *mpar;
-	STARPU_MALLOC(mpar, nparameters*n*sizeof(double));
+	_STARPU_MALLOC(mpar, nparameters*n*sizeof(double));
 	double *my;
-	STARPU_MALLOC(my, n*sizeof(double));
+	_STARPU_MALLOC(my, n*sizeof(double));
 
 	/* Loading old calibration */
 	if (calibrate==1)

+ 4 - 4
src/core/perfmodel/perfmodel.c

@@ -452,10 +452,10 @@ static char *_perf_model_dir_debug = NULL;
 
 void _starpu_set_perf_model_dirs()
 {
-	STARPU_MALLOC(_perf_model_dir, _PERF_MODEL_DIR_MAXLEN);
-	STARPU_MALLOC(_perf_model_dir_codelet, _PERF_MODEL_DIR_MAXLEN);
-	STARPU_MALLOC(_perf_model_dir_bus, _PERF_MODEL_DIR_MAXLEN);
-	STARPU_MALLOC(_perf_model_dir_debug, _PERF_MODEL_DIR_MAXLEN);
+	_STARPU_MALLOC(_perf_model_dir, _PERF_MODEL_DIR_MAXLEN);
+	_STARPU_MALLOC(_perf_model_dir_codelet, _PERF_MODEL_DIR_MAXLEN);
+	_STARPU_MALLOC(_perf_model_dir_bus, _PERF_MODEL_DIR_MAXLEN);
+	_STARPU_MALLOC(_perf_model_dir_debug, _PERF_MODEL_DIR_MAXLEN);
 
 #ifdef STARPU_PERF_MODEL_DIR
 	/* use the directory specified at configure time */

+ 7 - 7
src/core/perfmodel/perfmodel_bus.c

@@ -391,7 +391,7 @@ static void measure_bandwidth_between_host_and_dev_on_cpu_with_opencl(int dev, i
 	_starpu_bind_thread_on_cpu(config, cpu, STARPU_NOWORKERID);
         /* Allocate a buffer on the host */
 	unsigned char *h_buffer;
-	STARPU_MALLOC(h_buffer, size);
+	_STARPU_MALLOC(h_buffer, size);
 
 	/* hack to avoid third party libs to rebind threads */
 	_starpu_bind_thread_on_cpu(config, cpu, STARPU_NOWORKERID);
@@ -534,11 +534,11 @@ static void measure_bandwidth_between_cpus_and_dev(int dev, struct dev_timing *d
 
 	if (!no_node_obj_was_found)
 	{
-		STARPU_CALLOC(is_available_per_numa_node, nnuma_nodes, sizeof(unsigned));
-		STARPU_MALLOC(dev_timing_htod_per_numa_node, nnuma_nodes * sizeof(double));
-		STARPU_MALLOC(dev_latency_htod_per_numa_node, nnuma_nodes * sizeof(double));
-		STARPU_MALLOC(dev_timing_dtoh_per_numa_node, nnuma_nodes * sizeof(double));
-		STARPU_MALLOC(dev_latency_dtoh_per_numa_node, nnuma_nodes * sizeof(double));
+		_STARPU_CALLOC(is_available_per_numa_node, nnuma_nodes, sizeof(unsigned));
+		_STARPU_MALLOC(dev_timing_htod_per_numa_node, nnuma_nodes * sizeof(double));
+		_STARPU_MALLOC(dev_latency_htod_per_numa_node, nnuma_nodes * sizeof(double));
+		_STARPU_MALLOC(dev_timing_dtoh_per_numa_node, nnuma_nodes * sizeof(double));
+		_STARPU_MALLOC(dev_latency_dtoh_per_numa_node, nnuma_nodes * sizeof(double));
 	}
 #endif
 
@@ -1741,7 +1741,7 @@ static void allocate_userdata(hwloc_obj_t obj)
 	if (obj->userdata)
 		return;
 
-	STARPU_MALLOC(obj->userdata, sizeof(*data));
+	_STARPU_MALLOC(obj->userdata, sizeof(*data));
 	data = obj->userdata;
 	data->bw_up = 0.0;
 	data->bw_down = 0.0;

+ 29 - 29
src/core/perfmodel/perfmodel_history.c

@@ -73,7 +73,7 @@ void _starpu_perfmodel_malloc_per_arch(struct starpu_perfmodel *model, int comb,
 {
 	int i;
 
-	STARPU_MALLOC(model->state->per_arch[comb], nb_impl*sizeof(struct starpu_perfmodel_per_arch));
+	_STARPU_MALLOC(model->state->per_arch[comb], nb_impl*sizeof(struct starpu_perfmodel_per_arch));
 	for(i = 0; i < nb_impl; i++)
 	{
 		memset(&model->state->per_arch[comb][i], 0, sizeof(struct starpu_perfmodel_per_arch));
@@ -85,7 +85,7 @@ void _starpu_perfmodel_malloc_per_arch_is_set(struct starpu_perfmodel *model, in
 {
 	int i;
 
-	STARPU_MALLOC(model->state->per_arch_is_set[comb], nb_impl*sizeof(int));
+	_STARPU_MALLOC(model->state->per_arch_is_set[comb], nb_impl*sizeof(int));
 	for(i = 0; i < nb_impl; i++)
 	{
 		model->state->per_arch_is_set[comb][i] = 0;
@@ -145,10 +145,10 @@ int starpu_perfmodel_arch_comb_add(int ndevices, struct starpu_perfmodel_device*
 	{
 		// We need to allocate more arch_combs
 		nb_arch_combs = current_arch_comb+10;
-		STARPU_REALLOC(arch_combs, nb_arch_combs*sizeof(struct starpu_perfmodel_arch*));
+		_STARPU_REALLOC(arch_combs, nb_arch_combs*sizeof(struct starpu_perfmodel_arch*));
 	}
-	STARPU_MALLOC(arch_combs[current_arch_comb], sizeof(struct starpu_perfmodel_arch));
-	STARPU_MALLOC(arch_combs[current_arch_comb]->devices, ndevices*sizeof(struct starpu_perfmodel_device));
+	_STARPU_MALLOC(arch_combs[current_arch_comb], sizeof(struct starpu_perfmodel_arch));
+	_STARPU_MALLOC(arch_combs[current_arch_comb]->devices, ndevices*sizeof(struct starpu_perfmodel_device));
 	arch_combs[current_arch_comb]->ndevices = ndevices;
 	int dev;
 	for(dev = 0; dev < ndevices; dev++)
@@ -223,7 +223,7 @@ static void insert_history_entry(struct starpu_perfmodel_history_entry *entry, s
 	struct starpu_perfmodel_history_list *link;
 	struct starpu_perfmodel_history_table *table;
 
-	STARPU_MALLOC(link, sizeof(struct starpu_perfmodel_history_list));
+	_STARPU_MALLOC(link, sizeof(struct starpu_perfmodel_history_list));
 	link->next = *list;
 	link->entry = entry;
 	*list = link;
@@ -232,7 +232,7 @@ static void insert_history_entry(struct starpu_perfmodel_history_entry *entry, s
 	//HASH_FIND_UINT32_T(*history_ptr, &entry->footprint, table);
 	//STARPU_ASSERT(table == NULL);
 
-	STARPU_MALLOC(table, sizeof(*table));
+	_STARPU_MALLOC(table, sizeof(*table));
 	table->footprint = entry->footprint;
 	table->history_entry = entry;
 	HASH_ADD_UINT32_T(*history_ptr, footprint, table);
@@ -297,7 +297,7 @@ static void dump_reg_model(FILE *f, struct starpu_perfmodel *model, int comb, in
 			reg_model->ncoeff = model->ncombinations + 1;
 		}
 
-		STARPU_MALLOC(reg_model->coeff,  reg_model->ncoeff*sizeof(double));
+		_STARPU_MALLOC(reg_model->coeff,  reg_model->ncoeff*sizeof(double));
 		_starpu_multiple_regression(per_arch_model->list, reg_model->coeff, reg_model->ncoeff, model->nparameters, model->parameters_names, model->combinations, model->symbol);
 
 		fprintf(f, "# n\tintercept\t");
@@ -397,7 +397,7 @@ static void scan_reg_model(FILE *f, struct starpu_perfmodel_regression_model *re
 		res = fscanf(f, "%u", &reg_model->ncoeff);
 		STARPU_ASSERT_MSG(res == 1, "Incorrect performance model file");
 
-		STARPU_MALLOC(reg_model->coeff, reg_model->ncoeff*sizeof(double));
+		_STARPU_MALLOC(reg_model->coeff, reg_model->ncoeff*sizeof(double));
 
 		unsigned multi_invalid = 0;
 		unsigned i;
@@ -484,7 +484,7 @@ static void parse_per_arch_model_file(FILE *f, struct starpu_perfmodel_per_arch
 		struct starpu_perfmodel_history_entry *entry = NULL;
 		if (scan_history)
 		{
-			STARPU_MALLOC(entry, sizeof(struct starpu_perfmodel_history_entry));
+			_STARPU_MALLOC(entry, sizeof(struct starpu_perfmodel_history_entry));
 
 			/* Tell  helgrind that we do not care about
 			 * racing access to the sampling, we only want a
@@ -747,11 +747,11 @@ void _starpu_perfmodel_realloc(struct starpu_perfmodel *model, int nb)
 #ifdef SSIZE_MAX
 	STARPU_ASSERT((size_t) nb < SSIZE_MAX / sizeof(struct starpu_perfmodel_per_arch*));
 #endif
-	STARPU_REALLOC(model->state->per_arch, nb*sizeof(struct starpu_perfmodel_per_arch*));
-	STARPU_REALLOC(model->state->per_arch_is_set, nb*sizeof(int*));
-	STARPU_REALLOC(model->state->nimpls, nb*sizeof(int));
-	STARPU_REALLOC(model->state->nimpls_set, nb*sizeof(int));
-	STARPU_REALLOC(model->state->combs, nb*sizeof(int));
+	_STARPU_REALLOC(model->state->per_arch, nb*sizeof(struct starpu_perfmodel_per_arch*));
+	_STARPU_REALLOC(model->state->per_arch_is_set, nb*sizeof(int*));
+	_STARPU_REALLOC(model->state->nimpls, nb*sizeof(int));
+	_STARPU_REALLOC(model->state->nimpls_set, nb*sizeof(int));
+	_STARPU_REALLOC(model->state->combs, nb*sizeof(int));
 	for(i = model->state->ncombs_set; i < nb; i++)
 	{
 		model->state->per_arch[i] = NULL;
@@ -787,17 +787,17 @@ void starpu_perfmodel_init(struct starpu_perfmodel *model)
 		return;
 	}
 
-	STARPU_MALLOC(model->state, sizeof(struct _starpu_perfmodel_state));
+	_STARPU_MALLOC(model->state, sizeof(struct _starpu_perfmodel_state));
 	STARPU_PTHREAD_RWLOCK_INIT(&model->state->model_rwlock, NULL);
 
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&arch_combs_mutex);
 	model->state->ncombs_set = ncombs = nb_arch_combs;
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&arch_combs_mutex);
-	STARPU_MALLOC(model->state->per_arch, ncombs*sizeof(struct starpu_perfmodel_per_arch*));
-	STARPU_MALLOC(model->state->per_arch_is_set, ncombs*sizeof(int*));
-	STARPU_MALLOC(model->state->nimpls, ncombs*sizeof(int));
-	STARPU_MALLOC(model->state->nimpls_set, ncombs*sizeof(int));
-	STARPU_MALLOC(model->state->combs, ncombs*sizeof(int));
+	_STARPU_MALLOC(model->state->per_arch, ncombs*sizeof(struct starpu_perfmodel_per_arch*));
+	_STARPU_MALLOC(model->state->per_arch_is_set, ncombs*sizeof(int*));
+	_STARPU_MALLOC(model->state->nimpls, ncombs*sizeof(int));
+	_STARPU_MALLOC(model->state->nimpls_set, ncombs*sizeof(int));
+	_STARPU_MALLOC(model->state->combs, ncombs*sizeof(int));
 	model->state->ncombs = 0;
 
 	for(i = 0; i < ncombs; i++)
@@ -810,7 +810,7 @@ void starpu_perfmodel_init(struct starpu_perfmodel *model)
 
 	/* add the model to a linked list */
 	struct _starpu_perfmodel_list *node;
-	STARPU_MALLOC(node, sizeof(struct _starpu_perfmodel_list));
+	_STARPU_MALLOC(node, sizeof(struct _starpu_perfmodel_list));
 
 	node->model = model;
 	//model->debug_modelid = debug_modelid++;
@@ -915,7 +915,7 @@ void _starpu_initialize_registered_performance_models(void)
 	// We used to allocate 2**(ncores + ncuda + nopencl + nmic + nscc), this is too big
 	// We now allocate only 2*(ncores + ncuda + nopencl + nmic + nscc), and reallocate when necessary in starpu_perfmodel_arch_comb_add
 	nb_arch_combs = 2 * (ncores + ncuda + nopencl + nmic + nscc);
-	STARPU_MALLOC(arch_combs, nb_arch_combs*sizeof(struct starpu_perfmodel_arch*));
+	_STARPU_MALLOC(arch_combs, nb_arch_combs*sizeof(struct starpu_perfmodel_arch*));
 	current_arch_comb = 0;
 	STARPU_PTHREAD_RWLOCK_INIT(&arch_combs_mutex, NULL);
 	historymaxerror = starpu_get_env_number_default("STARPU_HISTORY_MAX_ERROR", STARPU_HISTORYMAXERROR);
@@ -1342,7 +1342,7 @@ double _starpu_multiple_regression_based_job_expected_perf(struct starpu_perfmod
 
 	double parameter_value;
 	double *parameters;
-	STARPU_MALLOC(parameters, model->nparameters*sizeof(double));
+	_STARPU_MALLOC(parameters, model->nparameters*sizeof(double));
 	model->parameters(j->task, parameters);
 	expected_duration=reg_model->coeff[0];
 	unsigned i, k;
@@ -1502,7 +1502,7 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 			if (!entry)
 			{
 				/* this is the first entry with such a footprint */
-				STARPU_MALLOC(entry, sizeof(struct starpu_perfmodel_history_entry));
+				_STARPU_MALLOC(entry, sizeof(struct starpu_perfmodel_history_entry));
 
 				/* Tell  helgrind that we do not care about
 				 * racing access to the sampling, we only want a
@@ -1617,14 +1617,14 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 			struct starpu_perfmodel_history_list **list;
 			list = &per_arch_model->list;
 
-			STARPU_CALLOC(entry, 1, sizeof(struct starpu_perfmodel_history_entry));
-			STARPU_MALLOC(entry->parameters, model->nparameters*sizeof(double));
+			_STARPU_CALLOC(entry, 1, sizeof(struct starpu_perfmodel_history_entry));
+			_STARPU_MALLOC(entry->parameters, model->nparameters*sizeof(double));
 			model->parameters(j->task, entry->parameters);
 			entry->tag = j->task->tag_id;
 			entry->duration = measured;
 
 			struct starpu_perfmodel_history_list *link;
-			STARPU_MALLOC(link, sizeof(struct starpu_perfmodel_history_list));
+			_STARPU_MALLOC(link, sizeof(struct starpu_perfmodel_history_list));
 			link->next = *list;
 			link->entry = entry;
 			*list = link;
@@ -1744,7 +1744,7 @@ struct starpu_perfmodel_per_arch *_starpu_perfmodel_get_model_per_devices(struct
 	va_end(varg_list_copy);
 
 	// We set the devices
-	STARPU_MALLOC(arch.devices, arch.ndevices * sizeof(struct starpu_perfmodel_device));
+	_STARPU_MALLOC(arch.devices, arch.ndevices * sizeof(struct starpu_perfmodel_device));
 	va_copy(varg_list_copy, varg_list);
 	for(i=0 ; i<arch.ndevices ; i++)
 	{

+ 4 - 4
src/core/perfmodel/perfmodel_print.c

@@ -190,7 +190,7 @@ int starpu_perfmodel_print_all(struct starpu_perfmodel *model, char *arch, char
 			int implid;
 			struct starpu_perfmodel_arch perf_arch;
 			perf_arch.ndevices = 1;
-			STARPU_MALLOC(perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+			_STARPU_MALLOC(perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 			perf_arch.devices[0].type = STARPU_CPU_WORKER;
 			perf_arch.devices[0].devid = 0;
 			perf_arch.devices[0].ncores = 1;
@@ -216,7 +216,7 @@ int starpu_perfmodel_print_all(struct starpu_perfmodel *model, char *arch, char
 			int implid;
 			struct starpu_perfmodel_arch perf_arch;
 			perf_arch.ndevices = 1;
-			STARPU_MALLOC(perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+			_STARPU_MALLOC(perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 			perf_arch.devices[0].type = STARPU_CPU_WORKER;
 			perf_arch.devices[0].devid = 0;
 			perf_arch.devices[0].ncores = k;
@@ -236,7 +236,7 @@ int starpu_perfmodel_print_all(struct starpu_perfmodel *model, char *arch, char
 			struct starpu_perfmodel_arch perf_arch;
 
 			perf_arch.ndevices = 1;
-			STARPU_MALLOC(perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+			_STARPU_MALLOC(perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 			perf_arch.devices[0].type = STARPU_CUDA_WORKER;
 			perf_arch.devices[0].ncores = 1;
 			int comb;
@@ -266,7 +266,7 @@ int starpu_perfmodel_print_all(struct starpu_perfmodel *model, char *arch, char
 		{
 			struct starpu_perfmodel_arch perf_arch;
 			perf_arch.ndevices = 1;
-			STARPU_MALLOC(perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+			_STARPU_MALLOC(perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 
 			perf_arch.devices[0].type = STARPU_CUDA_WORKER;
 			perf_arch.devices[0].devid = gpuid;

+ 2 - 2
src/core/perfmodel/regression.c

@@ -165,10 +165,10 @@ int _starpu_regression_non_linear_power(struct starpu_perfmodel_history_list *pt
 	STARPU_ASSERT(n);
 
 	unsigned *x;
-	STARPU_MALLOC(x, n*sizeof(unsigned));
+	_STARPU_MALLOC(x, n*sizeof(unsigned));
 
 	double *y;
-	STARPU_MALLOC(y, n*sizeof(double));
+	_STARPU_MALLOC(y, n*sizeof(double));
 	STARPU_ASSERT(y);
 
 	dump_list(x, y, ptr);

+ 6 - 6
src/core/sched_ctx.c

@@ -248,7 +248,7 @@ static void _starpu_add_workers_to_sched_ctx(struct _starpu_sched_ctx *sched_ctx
 
 		if(sched_ctx->perf_arch.devices == NULL)
 		{
-			STARPU_MALLOC(sched_ctx->perf_arch.devices, ndevices*sizeof(struct starpu_perfmodel_device));
+			_STARPU_MALLOC(sched_ctx->perf_arch.devices, ndevices*sizeof(struct starpu_perfmodel_device));
 		}
 		else
 		{
@@ -274,7 +274,7 @@ static void _starpu_add_workers_to_sched_ctx(struct _starpu_sched_ctx *sched_ctx
 
 
 			int nsize =  (sched_ctx->perf_arch.ndevices+nfinal_devices);
-			STARPU_REALLOC(sched_ctx->perf_arch.devices, nsize*sizeof(struct starpu_perfmodel_device));
+			_STARPU_REALLOC(sched_ctx->perf_arch.devices, nsize*sizeof(struct starpu_perfmodel_device));
 
 		}
 
@@ -502,7 +502,7 @@ struct _starpu_sched_ctx* _starpu_create_sched_ctx(struct starpu_sched_policy *p
 
 	if (policy)
 	{
-		STARPU_MALLOC(sched_ctx->sched_policy, sizeof(struct starpu_sched_policy));
+		_STARPU_MALLOC(sched_ctx->sched_policy, sizeof(struct starpu_sched_policy));
 	}
 	else
 	{
@@ -1619,7 +1619,7 @@ void* starpu_sched_ctx_get_policy_data(unsigned sched_ctx_id)
 struct starpu_worker_collection* starpu_sched_ctx_create_worker_collection(unsigned sched_ctx_id, enum starpu_worker_collection_type  worker_collection_type)
 {
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
-	STARPU_MALLOC(sched_ctx->workers, sizeof(struct starpu_worker_collection));
+	_STARPU_MALLOC(sched_ctx->workers, sizeof(struct starpu_worker_collection));
 
 	switch(worker_collection_type)
 	{
@@ -1690,7 +1690,7 @@ unsigned starpu_sched_ctx_get_workers_list(unsigned sched_ctx_id, int **workerid
 	struct starpu_sched_ctx_iterator it;
 
 	if(!workers) return 0;
-	STARPU_MALLOC(*workerids, workers->nworkers*sizeof(int));
+	_STARPU_MALLOC(*workerids, workers->nworkers*sizeof(int));
 
 	workers->init_iterator(workers, &it);
 	while(workers->has_next(workers, &it))
@@ -2381,7 +2381,7 @@ void starpu_sched_ctx_get_available_cpuids(unsigned sched_ctx_id, int **cpuids,
 	int current_worker_id = starpu_worker_get_id();
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 	struct starpu_worker_collection *workers = sched_ctx->workers;
-	STARPU_MALLOC((*cpuids), workers->nworkers*sizeof(int));
+	_STARPU_MALLOC((*cpuids), workers->nworkers*sizeof(int));
 	int w = 0;
 
 	struct starpu_sched_ctx_iterator it;

+ 3 - 3
src/core/sched_ctx_list.c

@@ -66,7 +66,7 @@ struct _starpu_sched_ctx_elt* _starpu_sched_ctx_elt_add_after(struct _starpu_sch
 {
 	struct _starpu_sched_ctx_elt *head, *next;
 	struct _starpu_sched_ctx_elt *elt;
-	STARPU_MALLOC(elt, sizeof(struct _starpu_sched_ctx_elt));
+	_STARPU_MALLOC(elt, sizeof(struct _starpu_sched_ctx_elt));
 
 	_starpu_sched_ctx_elt_init(elt, sched_ctx);
 	elt->parent = list;
@@ -98,7 +98,7 @@ struct _starpu_sched_ctx_elt* _starpu_sched_ctx_elt_add_before(struct _starpu_sc
 {
 	struct _starpu_sched_ctx_elt *head, *prev;
 	struct _starpu_sched_ctx_elt *elt;
-	STARPU_MALLOC(elt, sizeof(struct _starpu_sched_ctx_elt));
+	_STARPU_MALLOC(elt, sizeof(struct _starpu_sched_ctx_elt));
 
 	_starpu_sched_ctx_elt_init(elt, sched_ctx);
 	elt->parent = list;
@@ -196,7 +196,7 @@ struct _starpu_sched_ctx_elt* _starpu_sched_ctx_list_add_prio(struct _starpu_sch
 	}
 	else //l's priority is inferior or inexistant, add before
 	{
-		STARPU_MALLOC(parent_list, sizeof(struct _starpu_sched_ctx_list));
+		_STARPU_MALLOC(parent_list, sizeof(struct _starpu_sched_ctx_list));
 		parent_list->priority = prio;
 		parent_list->next = l;
 		parent_list->head = NULL;

+ 6 - 6
src/core/simgrid.c

@@ -250,7 +250,7 @@ int main(int argc, char **argv)
 
 	/* Create a simgrid process for main */
 	struct main_args *args;
-	STARPU_MALLOC(args, sizeof(*args));
+	_STARPU_MALLOC(args, sizeof(*args));
 	args->argc = argc;
 	args->argv = argv;
 	MSG_process_create_with_arguments("main", &do_starpu_main, calloc(MAX_TSD, sizeof(void*)), MSG_get_host_by_name("MAIN"), 0, (char**) args);
@@ -414,7 +414,7 @@ void _starpu_simgrid_submit_job(int workerid, struct _starpu_job *j, struct star
 	{
 		/* Asynchronous execution */
 		struct task *task;
-		STARPU_MALLOC(task, sizeof(*task));
+		_STARPU_MALLOC(task, sizeof(*task));
 		task->task = simgrid_task;
 		task->workerid = workerid;
 		task->finished = finished;
@@ -571,7 +571,7 @@ static void transfer_submit(struct transfer *transfer)
 			/* Make new wait for the old */
 			transfer->nwait++;
 			/* Make old wake the new */
-			STARPU_REALLOC(old->wake, (old->nwake + 1) * sizeof(old->wake));
+			_STARPU_REALLOC(old->wake, (old->nwake + 1) * sizeof(old->wake));
 			old->wake[old->nwake] = transfer;
 			old->nwake++;
 		}
@@ -601,9 +601,9 @@ int _starpu_simgrid_transfer(size_t size, unsigned src_node, unsigned dst_node,
 	starpu_pthread_cond_t cond;
 	unsigned finished;
 
-	STARPU_CALLOC(hosts, 2, sizeof(*hosts));
-	STARPU_CALLOC(computation, 2, sizeof(*computation));
-	STARPU_CALLOC(communication, 4, sizeof(*communication));
+	_STARPU_CALLOC(hosts, 2, sizeof(*hosts));
+	_STARPU_CALLOC(computation, 2, sizeof(*computation));
+	_STARPU_CALLOC(communication, 4, sizeof(*communication));
 
 	hosts[0] = _starpu_simgrid_memory_node_get_host(src_node);
 	hosts[1] = _starpu_simgrid_memory_node_get_host(dst_node);

+ 3 - 3
src/core/task.c

@@ -148,7 +148,7 @@ struct starpu_task * STARPU_ATTRIBUTE_MALLOC starpu_task_create(void)
 {
 	struct starpu_task *task;
 
-	STARPU_MALLOC(task, sizeof(struct starpu_task));
+	_STARPU_MALLOC(task, sizeof(struct starpu_task));
 	starpu_task_init(task);
 
 	/* Dynamically allocated tasks are destroyed by default */
@@ -309,7 +309,7 @@ int _starpu_submit_job(struct _starpu_job *j)
 	   && sched_ctx->perf_counters != NULL)
 	{
 		struct starpu_perfmodel_arch arch;
-		STARPU_MALLOC(arch.devices, sizeof(struct starpu_perfmodel_device));
+		_STARPU_MALLOC(arch.devices, sizeof(struct starpu_perfmodel_device));
 		arch.ndevices = 1;
 		arch.devices[0].type = STARPU_CPU_WORKER;
 		arch.devices[0].devid = 0;
@@ -550,7 +550,7 @@ static int _starpu_task_submit_head(struct starpu_task *task)
 
 		if (task->dyn_handles)
 		{
-			STARPU_MALLOC(task->dyn_interfaces, nbuffers * sizeof(void *));
+			_STARPU_MALLOC(task->dyn_interfaces, nbuffers * sizeof(void *));
 		}
 
 		for (i = 0; i < nbuffers; i++)

+ 4 - 4
src/core/task_bundle.c

@@ -28,7 +28,7 @@
 /* Initialize a task bundle */
 void starpu_task_bundle_create(starpu_task_bundle_t *bundle)
 {
-	STARPU_MALLOC(*bundle, sizeof(struct _starpu_task_bundle));
+	_STARPU_MALLOC(*bundle, sizeof(struct _starpu_task_bundle));
 
 	STARPU_PTHREAD_MUTEX_INIT(&(*bundle)->mutex, NULL);
 	/* Of course at the beginning a bundle is open,
@@ -61,7 +61,7 @@ int starpu_task_bundle_insert(starpu_task_bundle_t bundle, struct starpu_task *t
 
 	/* Insert a task at the end of the bundle */
 	struct _starpu_task_bundle_entry *entry;
-	STARPU_MALLOC(entry, sizeof(struct _starpu_task_bundle_entry));
+	_STARPU_MALLOC(entry, sizeof(struct _starpu_task_bundle_entry));
 	entry->task = task;
 	entry->next = NULL;
 
@@ -197,7 +197,7 @@ void _insertion_handle_sorted(struct _starpu_handle_list **listp, starpu_data_ha
 	if (!list || list->handle > handle)
 	{
 		struct _starpu_handle_list *link;
-		STARPU_MALLOC(link, sizeof(struct _starpu_handle_list));
+		_STARPU_MALLOC(link, sizeof(struct _starpu_handle_list));
 		link->handle = handle;
 		link->mode = mode;
 		link->next = list;
@@ -225,7 +225,7 @@ void _insertion_handle_sorted(struct _starpu_handle_list **listp, starpu_data_ha
 		/* The handle was not in the list, we insert it after 'prev', thus right before
 		 * 'list' which is the smallest following handle */
 		struct _starpu_handle_list *link;
-		STARPU_MALLOC(link, sizeof(struct _starpu_handle_list));
+		_STARPU_MALLOC(link, sizeof(struct _starpu_handle_list));
 		link->handle = handle;
 		link->mode = mode;
 		link->next = prev->next;

+ 9 - 9
src/core/topology.c

@@ -295,7 +295,7 @@ _starpu_initialize_workers_opencl_gpuid (struct _starpu_machine_config*config)
 			if (entry == NULL)
 			{
 				struct handle_entry *entry2;
-				STARPU_MALLOC(entry2, sizeof(*entry2));
+				_STARPU_MALLOC(entry2, sizeof(*entry2));
 				entry2->gpuid = devid;
 				HASH_ADD_INT(devices_already_used, gpuid,
 					     entry2);
@@ -810,7 +810,7 @@ _starpu_init_mic_config (struct _starpu_machine_config *config,
 		int worker_idx = topology->nworkers + miccore_id;
 		config->workers[worker_idx].set = &mic_worker_set[mic_idx];
 		config->workers[worker_idx].arch = STARPU_MIC_WORKER;
-		STARPU_MALLOC(config->workers[worker_idx].perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+		_STARPU_MALLOC(config->workers[worker_idx].perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 		config->workers[worker_idx].perf_arch.ndevices = 1;
 		config->workers[worker_idx].perf_arch.devices[0].type = STARPU_MIC_WORKER;
 		config->workers[worker_idx].perf_arch.devices[0].devid = mic_idx;
@@ -995,7 +995,7 @@ _starpu_init_machine_config(struct _starpu_machine_config *config, int no_mp_con
 
 			config->workers[worker_idx].set = &cuda_worker_set[devid];
 			config->workers[worker_idx].arch = STARPU_CUDA_WORKER;
-			STARPU_MALLOC(config->workers[worker_idx].perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+			_STARPU_MALLOC(config->workers[worker_idx].perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 			config->workers[worker_idx].perf_arch.ndevices = 1;
 			config->workers[worker_idx].perf_arch.devices[0].type = STARPU_CUDA_WORKER;
 			config->workers[worker_idx].perf_arch.devices[0].devid = devid;
@@ -1008,7 +1008,7 @@ _starpu_init_machine_config(struct _starpu_machine_config *config, int no_mp_con
 			config->worker_mask |= STARPU_CUDA;
 
 			struct handle_entry *entry;
-			STARPU_MALLOC(entry, sizeof(*entry));
+			_STARPU_MALLOC(entry, sizeof(*entry));
 			entry->gpuid = devid;
 			HASH_ADD_INT(devices_using_cuda, gpuid, entry);
 		}
@@ -1073,7 +1073,7 @@ _starpu_init_machine_config(struct _starpu_machine_config *config, int no_mp_con
 			break;
 		}
 		config->workers[worker_idx].arch = STARPU_OPENCL_WORKER;
-		STARPU_MALLOC(config->workers[worker_idx].perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+		_STARPU_MALLOC(config->workers[worker_idx].perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 		config->workers[worker_idx].perf_arch.ndevices = 1;
 		config->workers[worker_idx].perf_arch.devices[0].type = STARPU_OPENCL_WORKER;
 		config->workers[worker_idx].perf_arch.devices[0].devid = devid;
@@ -1137,7 +1137,7 @@ _starpu_init_machine_config(struct _starpu_machine_config *config, int no_mp_con
 	{
 		config->workers[topology->nworkers + sccdev].arch = STARPU_SCC_WORKER;
 		int devid = _starpu_get_next_scc_deviceid(config);
-		STARPU_MALLOC(config->workers[topology->nworkers + sccdev].perf_arch.devices, sizeof(struct starpu_perfmodel_device));
+		_STARPU_MALLOC(config->workers[topology->nworkers + sccdev].perf_arch.devices, sizeof(struct starpu_perfmodel_device));
 		config->workers[topology->nworkers + sccdev].perf_arch.ndevices = 1;
 
 		config->workers[topology->nworkers + sccdev].perf_arch.devices[0].type = STARPU_SCC_WORKER;
@@ -1206,7 +1206,7 @@ _starpu_init_machine_config(struct _starpu_machine_config *config, int no_mp_con
 	{
 		int worker_idx = topology->nworkers + cpu;
 		config->workers[worker_idx].arch = STARPU_CPU_WORKER;
-		STARPU_MALLOC(config->workers[worker_idx].perf_arch.devices,  sizeof(struct starpu_perfmodel_device));
+		_STARPU_MALLOC(config->workers[worker_idx].perf_arch.devices,  sizeof(struct starpu_perfmodel_device));
 		config->workers[worker_idx].perf_arch.ndevices = 1;
 		config->workers[worker_idx].perf_arch.devices[0].type = STARPU_CPU_WORKER;
 		config->workers[worker_idx].perf_arch.devices[0].devid = 0;
@@ -1714,13 +1714,13 @@ _starpu_init_workers_binding (struct _starpu_machine_config *config, int no_mp_c
 					config->nbindid = STARPU_NMAXWORKERS;
 				else
 					config->nbindid = 2 * old_nbindid;
-				STARPU_REALLOC(config->bindid_workers, config->nbindid * sizeof(config->bindid_workers[0]));
+				_STARPU_REALLOC(config->bindid_workers, config->nbindid * sizeof(config->bindid_workers[0]));
 				memset(&config->bindid_workers[old_nbindid], 0, (config->nbindid - old_nbindid) * sizeof(config->bindid_workers[0]));
 			}
 			/* Add slot for this worker */
 			/* Don't care about amortizing the cost, there are usually very few workers sharing the same bindid */
 			config->bindid_workers[bindid].nworkers++;
-			STARPU_REALLOC(config->bindid_workers[bindid].workerids, config->bindid_workers[bindid].nworkers * sizeof(config->bindid_workers[bindid].workerids[0]));
+			_STARPU_REALLOC(config->bindid_workers[bindid].workerids, config->bindid_workers[bindid].nworkers * sizeof(config->bindid_workers[bindid].workerids[0]));
 			config->bindid_workers[bindid].workerids[config->bindid_workers[bindid].nworkers-1] = worker;
 		}
 	}

+ 1 - 1
src/core/tree.c

@@ -37,7 +37,7 @@ void starpu_tree_reset_visited(struct starpu_tree *tree, char *visited)
 
 void starpu_tree_prepare_children(unsigned arity, struct starpu_tree *father)
 {
-	STARPU_MALLOC(father->nodes, arity*sizeof(struct starpu_tree));
+	_STARPU_MALLOC(father->nodes, arity*sizeof(struct starpu_tree));
 	father->arity = arity;
 }
 

+ 4 - 4
src/core/workers.c

@@ -1029,7 +1029,7 @@ static void _starpu_build_tree(void)
 {
 #ifdef STARPU_HAVE_HWLOC
 	struct starpu_tree *tree;
-	STARPU_MALLOC(tree, sizeof(struct starpu_tree));
+	_STARPU_MALLOC(tree, sizeof(struct starpu_tree));
 	_starpu_config.topology.tree = tree;
 
 	hwloc_obj_t root = hwloc_get_root_obj(_starpu_config.topology.hwtopology);
@@ -1175,7 +1175,7 @@ int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
 	{
 		size_t size = _starpu_config.conf.n_cuda_opengl_interoperability * sizeof(*_starpu_config.conf.cuda_opengl_interoperability);
 		unsigned *copy;
-		STARPU_MALLOC(copy, size);
+		_STARPU_MALLOC(copy, size);
 		memcpy(copy, _starpu_config.conf.cuda_opengl_interoperability, size);
 		_starpu_config.conf.cuda_opengl_interoperability = copy;
 	}
@@ -1183,7 +1183,7 @@ int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
 	{
 		size_t size = _starpu_config.conf.n_not_launched_drivers * sizeof(*_starpu_config.conf.not_launched_drivers);
 		struct starpu_driver *copy;
-		STARPU_MALLOC(copy, size);
+		_STARPU_MALLOC(copy, size);
 		memcpy(copy, _starpu_config.conf.not_launched_drivers, size);
 		_starpu_config.conf.not_launched_drivers = copy;
 	}
@@ -2119,7 +2119,7 @@ unsigned starpu_worker_get_sched_ctx_list(int workerid, unsigned **sched_ctxs)
 {
 	unsigned s = 0;
 	unsigned nsched_ctxs = _starpu_worker_get_nsched_ctxs(workerid);
-	STARPU_MALLOC(*sched_ctxs, nsched_ctxs*sizeof(unsigned));
+	_STARPU_MALLOC(*sched_ctxs, nsched_ctxs*sizeof(unsigned));
 	struct _starpu_worker *worker = _starpu_get_worker_struct(workerid);
 	struct _starpu_sched_ctx_elt *e = NULL;
 	struct _starpu_sched_ctx_list_iterator list_it;

+ 1 - 1
src/datawizard/coherency.c

@@ -1142,7 +1142,7 @@ void _starpu_fetch_nowhere_task_input(struct _starpu_job *j)
 		return;
 	}
 
-	STARPU_MALLOC(wrapper, (sizeof(*wrapper)));
+	_STARPU_MALLOC(wrapper, (sizeof(*wrapper)));
 	wrapper->j = j;
 	/* +1 for the call below */
 	wrapper->pending = nfetchbuffers + 1;

+ 1 - 1
src/datawizard/data_request.c

@@ -320,7 +320,7 @@ void _starpu_data_request_append_callback(struct _starpu_data_request *r, void (
 	if (callback_func)
 	{
 		struct _starpu_callback_list *link;
-		STARPU_MALLOC(link, sizeof(struct _starpu_callback_list));
+		_STARPU_MALLOC(link, sizeof(struct _starpu_callback_list));
 
 		link->callback_func = callback_func;
 		link->callback_arg = callback_arg;

+ 4 - 4
src/datawizard/filters.c

@@ -172,7 +172,7 @@ static void _starpu_data_partition(starpu_data_handle_t initial_handle, starpu_d
 	/* allocate the children */
 	if (inherit_state)
 	{
-		STARPU_CALLOC(initial_handle->children, nparts, sizeof(struct _starpu_data_state));
+		_STARPU_CALLOC(initial_handle->children, nparts, sizeof(struct _starpu_data_state));
 
 		/* this handle now has children */
 		initial_handle->nchildren = nparts;
@@ -556,14 +556,14 @@ void starpu_data_partition_plan(starpu_data_handle_t initial_handle, struct star
 
 	for (i = 0; i < nparts; i++)
 	{
-		STARPU_CALLOC(childrenp[i], 1, sizeof(struct _starpu_data_state));
+		_STARPU_CALLOC(childrenp[i], 1, sizeof(struct _starpu_data_state));
 	}
 	_starpu_data_partition(initial_handle, childrenp, nparts, f, 0);
 
 	if (!cl)
 	{
 		/* Create a codelet that will make the coherency on the home node */
-		STARPU_CALLOC(initial_handle->switch_cl, 1, sizeof(*initial_handle->switch_cl));
+		_STARPU_CALLOC(initial_handle->switch_cl, 1, sizeof(*initial_handle->switch_cl));
 		cl = initial_handle->switch_cl;
 		cl->where = STARPU_NOWHERE;
 		cl->nbuffers = STARPU_VARIABLE_NBUFFERS;
@@ -573,7 +573,7 @@ void starpu_data_partition_plan(starpu_data_handle_t initial_handle, struct star
 	if (initial_handle->switch_cl_nparts < nparts)
 	{
 		/* First initialization, or previous initialization was with fewer parts, enlarge it */
-		STARPU_REALLOC(cl->dyn_nodes, (nparts+1) * sizeof(*cl->dyn_nodes));
+		_STARPU_REALLOC(cl->dyn_nodes, (nparts+1) * sizeof(*cl->dyn_nodes));
 		for (i = initial_handle->switch_cl_nparts; i < nparts+1; i++)
 			cl->dyn_nodes[i] = home_node;
 		initial_handle->switch_cl_nparts = nparts;

+ 5 - 5
src/datawizard/interfaces/data_interface.c

@@ -149,7 +149,7 @@ void _starpu_data_register_ram_pointer(starpu_data_handle_t handle, void *ptr)
 {
 	struct handle_entry *entry;
 
-	STARPU_MALLOC(entry, sizeof(*entry));
+	_STARPU_MALLOC(entry, sizeof(*entry));
 
 	entry->pointer = ptr;
 	entry->handle = handle;
@@ -369,7 +369,7 @@ _starpu_data_initialize_per_worker(starpu_data_handle_t handle)
 
 	_starpu_spin_checklocked(&handle->header_lock);
 
-	STARPU_CALLOC(handle->per_worker, nworkers, sizeof(*handle->per_worker));
+	_STARPU_CALLOC(handle->per_worker, nworkers, sizeof(*handle->per_worker));
 
 	size_t interfacesize = handle->ops->interface_size;
 
@@ -395,7 +395,7 @@ _starpu_data_initialize_per_worker(starpu_data_handle_t handle)
 		replicate->initialized = 0;
 		replicate->memory_node = starpu_worker_get_memory_node(worker);
 
-		STARPU_CALLOC(replicate->data_interface, 1, interfacesize);
+		_STARPU_CALLOC(replicate->data_interface, 1, interfacesize);
 		/* duplicate  the content of the interface on node 0 */
 		memcpy(replicate->data_interface, handle->per_node[STARPU_MAIN_RAM].data_interface, interfacesize);
 	}
@@ -438,7 +438,7 @@ int _starpu_data_handle_init(starpu_data_handle_t handle, struct starpu_data_int
 
 		replicate->handle = handle;
 
-		STARPU_CALLOC(replicate->data_interface, 1, interfacesize);
+		_STARPU_CALLOC(replicate->data_interface, 1, interfacesize);
 	}
 
 	return 0;
@@ -448,7 +448,7 @@ static
 starpu_data_handle_t _starpu_data_handle_allocate(struct starpu_data_interface_ops *interface_ops, unsigned int mf_node)
 {
 	starpu_data_handle_t handle;
-	STARPU_CALLOC(handle, 1, sizeof(struct _starpu_data_state));
+	_STARPU_CALLOC(handle, 1, sizeof(struct _starpu_data_state));
 	_starpu_data_handle_init(handle, interface_ops, mf_node);
 	return handle;
 }

+ 1 - 1
src/datawizard/interfaces/multiformat_interface.c

@@ -649,7 +649,7 @@ static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node,
 	if (dst_multiformat->opencl_ptr == NULL)
 	{
 		/* XXX : it is weird that we might have to allocate memory here... */
-		STARPU_MALLOC(dst_multiformat->opencl_ptr, dst_multiformat->nx * dst_multiformat->ops->opencl_elemsize);
+		_STARPU_MALLOC(dst_multiformat->opencl_ptr, dst_multiformat->nx * dst_multiformat->ops->opencl_elemsize);
 	}
 	err = starpu_opencl_copy_opencl_to_ram((cl_mem)src_multiformat->opencl_ptr,
 					       src_node,

+ 1 - 1
src/datawizard/malloc.c

@@ -255,7 +255,7 @@ int starpu_malloc_flags(void **A, size_t dim, int flags)
 				}
 				unlink(name);
 				free(name);
-				STARPU_CALLOC(dumb, 1,_starpu_malloc_simulation_fold);
+				_STARPU_CALLOC(dumb, 1,_starpu_malloc_simulation_fold);
 				write(bogusfile, dumb, _starpu_malloc_simulation_fold);
 				free(dumb);
 			}

+ 1 - 1
src/datawizard/memstats.c

@@ -23,7 +23,7 @@
 void _starpu_memory_stats_init(starpu_data_handle_t handle STARPU_ATTRIBUTE_UNUSED)
 {
 #ifdef STARPU_MEMORY_STATS
-	STARPU_CALLOC(handle->memory_stats, 1, sizeof(struct _starpu_memory_stats));
+	_STARPU_CALLOC(handle->memory_stats, 1, sizeof(struct _starpu_memory_stats));
 #endif
 }
 

+ 1 - 1
src/datawizard/reduction.c

@@ -160,7 +160,7 @@ void _starpu_data_end_reduction_mode(starpu_data_handle_t handle)
 	/* Register all valid per-worker replicates */
 	unsigned nworkers = starpu_worker_get_count();
 	STARPU_ASSERT(!handle->reduction_tmp_handles);
-	STARPU_MALLOC(handle->reduction_tmp_handles, nworkers*sizeof(handle->reduction_tmp_handles[0]));
+	_STARPU_MALLOC(handle->reduction_tmp_handles, nworkers*sizeof(handle->reduction_tmp_handles[0]));
 	for (worker = 0; worker < nworkers; worker++)
 	{
 		if (handle->per_worker[worker].initialized)

+ 2 - 2
src/datawizard/user_interactions.c

@@ -127,7 +127,7 @@ int starpu_data_acquire_on_node_cb_sequential_consistency(starpu_data_handle_t h
         _STARPU_LOG_IN();
 
 	struct user_interaction_wrapper *wrapper;
-	STARPU_MALLOC(wrapper, sizeof(struct user_interaction_wrapper));
+	_STARPU_MALLOC(wrapper, sizeof(struct user_interaction_wrapper));
 
 	wrapper->handle = handle;
 	wrapper->node = node;
@@ -389,7 +389,7 @@ int _starpu_prefetch_data_on_node_with_mode(starpu_data_handle_t handle, unsigne
 	STARPU_ASSERT_MSG(async || _starpu_worker_may_perform_blocking_calls(), "Synchronous prefetch is not possible from a task or a callback");
 
 	struct user_interaction_wrapper *wrapper;
-	STARPU_MALLOC(wrapper, sizeof(*wrapper));
+	_STARPU_MALLOC(wrapper, sizeof(*wrapper));
 
 	wrapper->handle = handle;
 	wrapper->node = node;

+ 2 - 2
src/debug/traces/anim.c

@@ -57,7 +57,7 @@ static struct component *fxt_component_root(void)
 void _starpu_fxt_component_new(uint64_t component, char *name)
 {
 	struct component *comp;
-	STARPU_MALLOC(comp, sizeof(*comp));
+	_STARPU_MALLOC(comp, sizeof(*comp));
 
 	if (!strncmp(name, "worker ", 7))
 	{
@@ -369,7 +369,7 @@ void _starpu_fxt_component_connect(uint64_t parent, uint64_t child)
 	STARPU_ASSERT(child_p);
 
 	n = ++parent_p->nchildren;
-	STARPU_REALLOC(parent_p->children, n * sizeof(*parent_p->children));
+	_STARPU_REALLOC(parent_p->children, n * sizeof(*parent_p->children));
 	parent_p->children[n-1] = child_p;
 	if (!child_p->parent)
 		child_p->parent = parent_p;

+ 8 - 8
src/debug/traces/starpu_fxt.c

@@ -108,7 +108,7 @@ static struct task_info *get_task(unsigned long job_id, int mpi_rank)
 	HASH_FIND(hh, tasks_info, &job_id, sizeof(job_id), task);
 	if (!task)
 	{
-		STARPU_MALLOC(task, sizeof(*task));
+		_STARPU_MALLOC(task, sizeof(*task));
 		task->model_name = NULL;
 		task->name = NULL;
 		task->exclude_from_dag = 0;
@@ -396,7 +396,7 @@ static int register_thread(unsigned long tid, int workerid, int sync)
 	if (entry)
 		return 0;
 
-	STARPU_MALLOC(entry, sizeof(*entry));
+	_STARPU_MALLOC(entry, sizeof(*entry));
 	entry->tid = tid;
 	entry->workerid = workerid;
 	entry->sync = sync;
@@ -864,7 +864,7 @@ static void handle_worker_init_start(struct fxt_ev_64 *ev, struct starpu_fxt_opt
 	char *kindstr = "";
 	struct starpu_perfmodel_arch arch;
 	arch.ndevices = 1;
-	STARPU_MALLOC(arch.devices, sizeof(struct starpu_perfmodel_device));
+	_STARPU_MALLOC(arch.devices, sizeof(struct starpu_perfmodel_device));
 
 	switch (ev->param[0])
 	{
@@ -1034,7 +1034,7 @@ static void create_paje_state_if_not_found(char *name, struct starpu_fxt_options
 
 	/* it's the first time ... */
 	struct _starpu_symbol_name *entry = _starpu_symbol_name_new();
-	STARPU_MALLOC(entry->name, strlen(name) + 1);
+	_STARPU_MALLOC(entry->name, strlen(name) + 1);
 	strcpy(entry->name, name);
 
 	_starpu_symbol_name_list_push_front(&symbol_list, entry);
@@ -1236,7 +1236,7 @@ static void handle_codelet_data_handle(struct fxt_ev_64 *ev, struct starpu_fxt_o
 	}
 	if (alloc)
 	{
-		STARPU_REALLOC(task->data, sizeof(*task->data) * alloc);
+		_STARPU_REALLOC(task->data, sizeof(*task->data) * alloc);
 	}
 	task->data[task->ndata].handle = ev->param[1];
 	task->data[task->ndata].size = ev->param[2];
@@ -1326,7 +1326,7 @@ static void handle_end_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_opti
 	if (options->dumped_codelets)
 	{
 		dumped_codelets_count++;
-		STARPU_REALLOC(dumped_codelets, dumped_codelets_count*sizeof(struct starpu_fxt_codelet_event));
+		_STARPU_REALLOC(dumped_codelets, dumped_codelets_count*sizeof(struct starpu_fxt_codelet_event));
 
 		snprintf(dumped_codelets[dumped_codelets_count - 1].symbol, sizeof(dumped_codelets[dumped_codelets_count - 1].symbol)-1, "%s", _starpu_last_codelet_symbol[worker]);
 		dumped_codelets[dumped_codelets_count - 1].symbol[sizeof(dumped_codelets[dumped_codelets_count - 1].symbol)-1] = 0;
@@ -2007,7 +2007,7 @@ static void handle_task_deps(struct fxt_ev_64 *ev, struct starpu_fxt_options *op
 	}
 	if (alloc)
 	{
-		STARPU_REALLOC(task->dependencies, sizeof(*task->dependencies) * alloc);
+		_STARPU_REALLOC(task->dependencies, sizeof(*task->dependencies) * alloc);
 	}
 	task->dependencies[task->ndeps++] = dep_prev;
 
@@ -3395,7 +3395,7 @@ static void write_task(struct parse_task pt)
 	//fprintf(stderr, "%p %p %s\n", kernel, kernels, codelet_name);
 	if(kernel == NULL)
 	{
-		STARPU_MALLOC(kernel, sizeof(*kernel));
+		_STARPU_MALLOC(kernel, sizeof(*kernel));
 		kernel->name = strdup(codelet_name);
 		//fprintf(stderr, "%s\n", kernel->name);
 		kernel->file = fopen(codelet_name, "w+");

+ 2 - 2
src/debug/traces/starpu_fxt_mpi.c

@@ -132,7 +132,7 @@ void _starpu_fxt_mpi_add_send_transfer(int src, int dst STARPU_ATTRIBUTE_UNUSED,
 			mpi_sends_list_size[src] = 1;
 		}
 
-		STARPU_REALLOC(mpi_sends[src], mpi_sends_list_size[src]*sizeof(struct mpi_transfer));
+		_STARPU_REALLOC(mpi_sends[src], mpi_sends_list_size[src]*sizeof(struct mpi_transfer));
 	}
 
 	mpi_sends[src][slot].matched = 0;
@@ -157,7 +157,7 @@ void _starpu_fxt_mpi_add_recv_transfer(int src STARPU_ATTRIBUTE_UNUSED, int dst,
 			mpi_recvs_list_size[dst] = 1;
 		}
 
-		STARPU_REALLOC(mpi_recvs[dst], mpi_recvs_list_size[dst]*sizeof(struct mpi_transfer));
+		_STARPU_REALLOC(mpi_recvs[dst], mpi_recvs_list_size[dst]*sizeof(struct mpi_transfer));
 	}
 
 	mpi_recvs[dst][slot].matched = 0;

+ 2 - 2
src/drivers/mic/driver_mic_sink.c

@@ -54,7 +54,7 @@ void _starpu_mic_sink_init(struct _starpu_mp_node *node)
 									 STARPU_MIC_SOURCE_DT_PORT_NUMBER);
 
 	node->nb_cores = COISysGetHardwareThreadCount() - COISysGetHardwareThreadCount() / COISysGetCoreCount();
-	STARPU_MALLOC(node->thread_table, sizeof(starpu_pthread_t)*node->nb_cores);
+	_STARPU_MALLOC(node->thread_table, sizeof(starpu_pthread_t)*node->nb_cores);
 
 #ifdef STARPU_DEVEL
 #warning rather use hwloc
@@ -106,7 +106,7 @@ void _starpu_mic_sink_launch_workers(struct _starpu_mp_node *node)
 		STARPU_ASSERT(ret == 0);
 
 		/*prepare the argument for the thread*/
-		STARPU_MALLOC(arg, sizeof(struct arg_sink_thread));
+		_STARPU_MALLOC(arg, sizeof(struct arg_sink_thread));
 		arg->coreid = i;
 		arg->node = node;
 

+ 4 - 4
src/drivers/mp_common/mp_common.c

@@ -109,7 +109,7 @@ _starpu_mp_common_node_create(enum _starpu_mp_node_kind node_kind,
 {
 	struct _starpu_mp_node *node;
 
-	STARPU_MALLOC(node, sizeof(struct _starpu_mp_node));
+	_STARPU_MALLOC(node, sizeof(struct _starpu_mp_node));
 
 	node->kind = node_kind;
 
@@ -235,7 +235,7 @@ _starpu_mp_common_node_create(enum _starpu_mp_node_kind node_kind,
 
 	/* Let's allocate the buffer, we want it to be big enough to contain
 	 * a command, an argument and the argument size */
-	STARPU_MALLOC(node->buffer, BUFFER_SIZE);
+	_STARPU_MALLOC(node->buffer, BUFFER_SIZE);
 
 	if (node->init)
 		node->init(node);
@@ -248,8 +248,8 @@ _starpu_mp_common_node_create(enum _starpu_mp_node_kind node_kind,
 	{
 		int i;
 		node->is_running = 1;
-		STARPU_MALLOC(node->run_table, sizeof(struct mp_task *)*node->nb_cores);
-		STARPU_MALLOC(node->sem_run_table, sizeof(sem_t)*node->nb_cores);
+		_STARPU_MALLOC(node->run_table, sizeof(struct mp_task *)*node->nb_cores);
+		_STARPU_MALLOC(node->sem_run_table, sizeof(sem_t)*node->nb_cores);
 
 		for(i=0; i<node->nb_cores; i++)
 		{

+ 7 - 7
src/drivers/mp_common/sink_common.c

@@ -88,7 +88,7 @@ void _starpu_sink_common_allocate(const struct _starpu_mp_node *mp_node,
 	STARPU_ASSERT(arg_size == sizeof(size_t));
 
 	void *addr;
-	STARPU_MALLOC(addr, *(size_t *)(arg));
+	_STARPU_MALLOC(addr, *(size_t *)(arg));
 
 	/* If the allocation fail, let's send an error to the host.
 	 */
@@ -376,7 +376,7 @@ static void _starpu_sink_common_pre_execution_message(struct _starpu_mp_node *no
 	/* Init message to tell the sink that the execution has begun */
 	struct mp_message * message = mp_message_new();
 	message->type = STARPU_MP_COMMAND_PRE_EXECUTION;
-	STARPU_MALLOC(message->buffer, sizeof(int));
+	_STARPU_MALLOC(message->buffer, sizeof(int));
 	*(int *) message->buffer = task->combined_workerid;
 	message->size = sizeof(int);
 
@@ -393,7 +393,7 @@ static void _starpu_sink_common_execution_completed_message(struct _starpu_mp_no
 	/* Init message to tell the sink that the execution is completed */
 	struct mp_message * message = mp_message_new();
 	message->type = STARPU_MP_COMMAND_EXECUTION_COMPLETED;
-	STARPU_MALLOC(message->buffer, sizeof(int));
+	_STARPU_MALLOC(message->buffer, sizeof(int));
 	*(int*) message->buffer = task->coreid;
 	message->size = sizeof(int);
 
@@ -407,7 +407,7 @@ static void _starpu_sink_common_bind_to_combined_worker(struct _starpu_mp_node *
 {
 	int i;
 	int * bind_set;
-	STARPU_MALLOC(bind_set, sizeof(int)*combined_worker->worker_size);
+	_STARPU_MALLOC(bind_set, sizeof(int)*combined_worker->worker_size);
 	for(i=0;i<combined_worker->worker_size;i++)
 		bind_set[i] = combined_worker->combined_workerid[i] - node->baseworkerid;
 	node->bind_thread(node, coreid, bind_set, combined_worker->worker_size);
@@ -571,7 +571,7 @@ void _starpu_sink_common_execute(struct _starpu_mp_node *node,
 	uintptr_t arg_ptr = (uintptr_t) arg;
 	struct mp_task *task;
 
-	STARPU_MALLOC(task, sizeof(struct mp_task));
+	_STARPU_MALLOC(task, sizeof(struct mp_task));
 	task->kernel = *(void(**)(void **, void *)) arg_ptr;
 	arg_ptr += sizeof(task->kernel);
 
@@ -595,7 +595,7 @@ void _starpu_sink_common_execute(struct _starpu_mp_node *node,
 	task->nb_interfaces = *(unsigned *) arg_ptr;
 	arg_ptr += sizeof(task->nb_interfaces);
 
-	STARPU_MALLOC(task->interfaces, task->nb_interfaces * sizeof(*task->interfaces));
+	_STARPU_MALLOC(task->interfaces, task->nb_interfaces * sizeof(*task->interfaces));
 
 	/* The function needs an array pointing to each interface it needs
 	 * during execution. As in sink-side there is no mean to know which
@@ -604,7 +604,7 @@ void _starpu_sink_common_execute(struct _starpu_mp_node *node,
 	for (i = 0; i < task->nb_interfaces; i++)
 	{
 		union _starpu_interface * interface;
-		STARPU_MALLOC(interface, sizeof(union _starpu_interface));
+		_STARPU_MALLOC(interface, sizeof(union _starpu_interface));
 		memcpy(interface, (void*) arg_ptr, sizeof(union _starpu_interface));
 		task->interfaces[i] = interface;
 		arg_ptr += sizeof(union _starpu_interface);

+ 3 - 3
src/drivers/mp_common/source_common.c

@@ -158,7 +158,7 @@ int _starpu_src_common_store_message(struct _starpu_mp_node *node,
 		case STARPU_MP_COMMAND_PRE_EXECUTION:
 			message = mp_message_new();
 			message->type = answer;
-			STARPU_MALLOC(message->buffer, arg_size);
+			_STARPU_MALLOC(message->buffer, arg_size);
 			memcpy(message->buffer, arg, arg_size);
 			message->size = arg_size;
 
@@ -340,7 +340,7 @@ int _starpu_src_common_execute_kernel(struct _starpu_mp_node *node,
 	 * a pointer to the function (sink-side), core on which execute this
 	 * function (sink-side), number of interfaces we send,
 	 * an array of generic (union) interfaces and the value of cl_arg */
-	STARPU_MALLOC(buffer, buffer_size);
+	_STARPU_MALLOC(buffer, buffer_size);
 	buffer_ptr = (uintptr_t) buffer;
 
 	*(void(**)(void)) buffer = kernel;
@@ -679,7 +679,7 @@ void _starpu_src_common_worker(struct _starpu_worker_set * worker_set,
 	unsigned memnode = worker_set->workers[0].memory_node;
 	struct starpu_task **tasks;
 
-	STARPU_MALLOC(tasks, sizeof(struct starpu_task *)*worker_set->nworkers);
+	_STARPU_MALLOC(tasks, sizeof(struct starpu_task *)*worker_set->nworkers);
 
 	_starpu_src_common_send_workers(mp_node, baseworkerid, worker_set->nworkers);
 

+ 11 - 11
src/drivers/opencl/driver_opencl_utils.c

@@ -53,14 +53,14 @@ int _starpu_opencl_locate_file(const char *source_file_name, char **located_file
 	_STARPU_DEBUG("Trying to locate <%s>\n", source_file_name);
 	if (access(source_file_name, R_OK) == 0)
 	{
-		STARPU_CALLOC(*located_file_name, 1, strlen(source_file_name)+1);
+		_STARPU_CALLOC(*located_file_name, 1, strlen(source_file_name)+1);
 		sprintf(*located_file_name, "%s", source_file_name);
 		ret = EXIT_SUCCESS;
 	}
 
 	if (ret == EXIT_FAILURE && _starpu_opencl_program_dir)
 	{
-		STARPU_CALLOC(*located_file_name, 1, strlen(_starpu_opencl_program_dir)+1+strlen(source_file_name)+1);
+		_STARPU_CALLOC(*located_file_name, 1, strlen(_starpu_opencl_program_dir)+1+strlen(source_file_name)+1);
 		sprintf(*located_file_name, "%s/%s", _starpu_opencl_program_dir, source_file_name);
 		_STARPU_DEBUG("Trying to locate <%s>\n", *located_file_name);
 		if (access(*located_file_name, R_OK) == 0)
@@ -69,7 +69,7 @@ int _starpu_opencl_locate_file(const char *source_file_name, char **located_file
 
 	if (ret == EXIT_FAILURE)
 	{
-		STARPU_CALLOC(*located_file_name, 1, strlen(STARPU_SRC_DIR)+1+strlen(source_file_name)+1);
+		_STARPU_CALLOC(*located_file_name, 1, strlen(STARPU_SRC_DIR)+1+strlen(source_file_name)+1);
 		sprintf(*located_file_name, "%s/%s", STARPU_SRC_DIR, source_file_name);
 		_STARPU_DEBUG("Trying to locate <%s>\n", *located_file_name);
 		if (access(*located_file_name, R_OK) == 0)
@@ -78,7 +78,7 @@ int _starpu_opencl_locate_file(const char *source_file_name, char **located_file
 
 	if (ret == EXIT_FAILURE)
 	{
-		STARPU_CALLOC(*located_file_name, 1, strlen(_STARPU_STRINGIFY(STARPU_OPENCL_DATADIR))+1+strlen(source_file_name)+1);
+		_STARPU_CALLOC(*located_file_name, 1, strlen(_STARPU_STRINGIFY(STARPU_OPENCL_DATADIR))+1+strlen(source_file_name)+1);
 		sprintf(*located_file_name, "%s/%s", _STARPU_STRINGIFY(STARPU_OPENCL_DATADIR), source_file_name);
 		_STARPU_DEBUG("Trying to locate <%s>\n", *located_file_name);
 		if (access(*located_file_name, R_OK) == 0)
@@ -95,12 +95,12 @@ int _starpu_opencl_locate_file(const char *source_file_name, char **located_file
 
 		if (!last)
 		{
-			STARPU_CALLOC(*located_dir_name, 2, sizeof(char));
+			_STARPU_CALLOC(*located_dir_name, 2, sizeof(char));
 			sprintf(*located_dir_name, "%s", "");
 		}
 		else
 		{
-			STARPU_CALLOC(*located_dir_name, 1, 1+strlen(*located_file_name));
+			_STARPU_CALLOC(*located_dir_name, 1, 1+strlen(*located_file_name));
 			sprintf(*located_dir_name, "%s", *located_file_name);
 			(*located_dir_name)[strlen(*located_file_name)-strlen(last)+1] = '\0';
 		}
@@ -161,7 +161,7 @@ char *_starpu_opencl_load_program_source(const char *filename)
 
 	err = stat(filename, &statbuf);
 	STARPU_ASSERT_MSG(err == 0, "could not open file %s\n", filename);
-	STARPU_MALLOC(source, statbuf.st_size + 1);
+	_STARPU_MALLOC(source, statbuf.st_size + 1);
 
 	for(c=(char)fgetc(fh), x=0 ; c != EOF ; c =(char)fgetc(fh), x++)
 	{
@@ -311,7 +311,7 @@ int _starpu_opencl_compile_or_load_opencl_from_string(const char *opencl_program
 			if (len > 2)
 			{
 				char *buffer;
-				STARPU_MALLOC(buffer, len);
+				_STARPU_MALLOC(buffer, len);
 
 				clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, len, buffer, &len);
 				_STARPU_DISP("Compilation output\n%s\n", buffer);
@@ -345,7 +345,7 @@ int _starpu_opencl_compile_or_load_opencl_from_string(const char *opencl_program
 
 			err = clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES, sizeof(size_t), &binary_len, NULL);
 			if (STARPU_UNLIKELY(err != CL_SUCCESS)) STARPU_OPENCL_REPORT_ERROR(err);
-			STARPU_MALLOC(binary, binary_len);
+			_STARPU_MALLOC(binary, binary_len);
 
 			err = clGetProgramInfo(program, CL_PROGRAM_BINARIES, sizeof(binary), &binary, NULL);
 			if (STARPU_UNLIKELY(err != CL_SUCCESS)) STARPU_OPENCL_REPORT_ERROR(err);
@@ -381,7 +381,7 @@ void starpu_opencl_load_program_source_malloc(const char *source_file_name, char
 	if(!source)
 		_STARPU_ERROR("Failed to load compute program from file <%s>!\n", *located_file_name);
 
-	STARPU_MALLOC(*opencl_program_source, strlen(source)+1);
+	_STARPU_MALLOC(*opencl_program_source, strlen(source)+1);
 	sprintf(*opencl_program_source, "%s", source);
 	free(source);
 }
@@ -524,7 +524,7 @@ int starpu_opencl_load_binary_opencl(const char *kernel_id, struct starpu_opencl
 			if (len > 2)
 			{
 				char *buffer;
-				STARPU_MALLOC(buffer, len);
+				_STARPU_MALLOC(buffer, len);
 
 				clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, len, buffer, &len);
 				_STARPU_DISP("Compilation output\n%s\n", buffer);

+ 7 - 7
src/profiling/bound.c

@@ -193,7 +193,7 @@ static double** initialize_arch_duration(int maxdevid, unsigned* maxncore_table)
 {
 	int devid, maxncore;
 	double ** arch_model;
-	STARPU_MALLOC(arch_model, sizeof(*arch_model)*(maxdevid+1));
+	_STARPU_MALLOC(arch_model, sizeof(*arch_model)*(maxdevid+1));
 	arch_model[maxdevid] = NULL;
 	for(devid=0; devid<maxdevid; devid++)
 	{
@@ -201,7 +201,7 @@ static double** initialize_arch_duration(int maxdevid, unsigned* maxncore_table)
 			maxncore = maxncore_table[devid];
 		else
 			maxncore = 1;
-		STARPU_CALLOC(arch_model[devid], maxncore+1,sizeof(*arch_model[devid]));
+		_STARPU_CALLOC(arch_model[devid], maxncore+1,sizeof(*arch_model[devid]));
 	}
 	return arch_model;
 }
@@ -235,7 +235,7 @@ static void new_task(struct _starpu_job *j)
 	if (j->bound_task)
 		return;
 
-	STARPU_MALLOC(t, sizeof(*t));
+	_STARPU_MALLOC(t, sizeof(*t));
 	memset(t, 0, sizeof(*t));
 	t->id = j->job_id;
 	t->tag_id = j->task->tag_id;
@@ -287,7 +287,7 @@ void _starpu_bound_record(struct _starpu_job *j)
 
 		if (!tp)
 		{
-			STARPU_MALLOC(tp, sizeof(*tp));
+			_STARPU_MALLOC(tp, sizeof(*tp));
 			tp->cl = j->task->cl;
 			tp->footprint = j->footprint;
 			tp->n = 0;
@@ -318,7 +318,7 @@ void _starpu_bound_tag_dep(starpu_tag_t id, starpu_tag_t dep_id)
 		return;
 	}
 
-	STARPU_MALLOC(td, sizeof(*td));
+	_STARPU_MALLOC(td, sizeof(*td));
 	td->tag = id;
 	td->dep_tag = dep_id;
 	td->next = tag_deps;
@@ -355,7 +355,7 @@ void _starpu_bound_task_dep(struct _starpu_job *j, struct _starpu_job *dep_j)
 	if (i == t->depsn)
 	{
 		/* Not already there, add */
-		STARPU_REALLOC(t->deps, ++t->depsn * sizeof(t->deps[0]));
+		_STARPU_REALLOC(t->deps, ++t->depsn * sizeof(t->deps[0]));
 		t->deps[t->depsn-1].dep = dep_j->bound_task;
 		t->deps[t->depsn-1].size = 0; /* We don't have data information in that case */
 	}
@@ -412,7 +412,7 @@ void _starpu_bound_job_id_dep(starpu_data_handle_t handle, struct _starpu_job *j
 	if (i == t->depsn)
 	{
 		/* Not already there, add */
-		STARPU_REALLOC(t->deps, ++t->depsn * sizeof(t->deps[0]));
+		_STARPU_REALLOC(t->deps, ++t->depsn * sizeof(t->deps[0]));
 		t->deps[t->depsn-1].dep = dep_t;
 		t->deps[t->depsn-1].size = _starpu_data_get_size(handle);
 	}

+ 1 - 1
src/profiling/profiling.c

@@ -147,7 +147,7 @@ struct starpu_profiling_task_info *_starpu_allocate_profiling_info_if_needed(str
 	/* If we are benchmarking, we need room for the energy */
 	if (starpu_profiling_status_get() || (task->cl && task->cl->energy_model && (task->cl->energy_model->benchmarking || _starpu_get_calibrate_flag())))
 	{
-		STARPU_CALLOC(info, 1, sizeof(struct starpu_profiling_task_info));
+		_STARPU_CALLOC(info, 1, sizeof(struct starpu_profiling_task_info));
 	}
 
 	return info;

+ 2 - 2
src/sched_policies/component_composed.c

@@ -37,7 +37,7 @@ struct starpu_sched_component_composed_recipe
 struct starpu_sched_component_composed_recipe * starpu_sched_component_composed_recipe_create(void)
 {
 	struct starpu_sched_component_composed_recipe *recipe;
-	STARPU_MALLOC(recipe, sizeof(*recipe));
+	_STARPU_MALLOC(recipe, sizeof(*recipe));
 	fun_create_component_list_init(&recipe->list);
 	return recipe;
 }
@@ -214,7 +214,7 @@ struct starpu_sched_component * starpu_sched_component_composed_component_create
 	struct starpu_sched_component * component = starpu_sched_component_create(tree, "composed");
 
 	struct composed_component *c;
-	STARPU_MALLOC(c, sizeof(struct composed_component));
+	_STARPU_MALLOC(c, sizeof(struct composed_component));
 	*c = create_composed_component(tree, recipe
 #ifdef STARPU_HAVE_HWLOC
 				  ,component->obj

+ 1 - 1
src/sched_policies/component_fifo.c

@@ -242,7 +242,7 @@ struct starpu_sched_component * starpu_sched_component_fifo_create(struct starpu
 {
 	struct starpu_sched_component *component = starpu_sched_component_create(tree, "fifo");
 	struct _starpu_fifo_data *data;
-	STARPU_MALLOC(data, sizeof(*data));
+	_STARPU_MALLOC(data, sizeof(*data));
 	data->fifo = _starpu_create_fifo();
 	STARPU_PTHREAD_MUTEX_INIT(&data->mutex,NULL);
 	component->data = data;

+ 1 - 1
src/sched_policies/component_heft.c

@@ -231,7 +231,7 @@ struct starpu_sched_component * starpu_sched_component_heft_create(struct starpu
 	struct starpu_sched_component * component = starpu_sched_component_create(tree, "heft");
 	struct _starpu_mct_data *mct_data = starpu_mct_init_parameters(params);
 	struct _starpu_heft_data *data;
-	STARPU_MALLOC(data, sizeof(*data));
+	_STARPU_MALLOC(data, sizeof(*data));
 
 	_starpu_prio_deque_init(&data->prio);
 	STARPU_PTHREAD_MUTEX_INIT(&data->mutex,NULL);

+ 1 - 1
src/sched_policies/component_perfmodel_select.c

@@ -73,7 +73,7 @@ struct starpu_sched_component * starpu_sched_component_perfmodel_select_create(s
 	struct starpu_sched_component * component = starpu_sched_component_create(tree, "perfmodel_selector");
 
 	struct _starpu_perfmodel_select_data *data;
-	STARPU_MALLOC(data, sizeof(*data));
+	_STARPU_MALLOC(data, sizeof(*data));
 
 	data->calibrator_component = params->calibrator_component;
 	data->no_perfmodel_component = params->no_perfmodel_component;

+ 1 - 1
src/sched_policies/component_prio.c

@@ -263,7 +263,7 @@ struct starpu_sched_component * starpu_sched_component_prio_create(struct starpu
 {
 	struct starpu_sched_component * component = starpu_sched_component_create(tree, "prio");
 	struct _starpu_prio_data *data;
-	STARPU_MALLOC(data, sizeof(*data));
+	_STARPU_MALLOC(data, sizeof(*data));
 	_starpu_prio_deque_init(&data->prio);
 	STARPU_PTHREAD_MUTEX_INIT(&data->mutex,NULL);
 	component->data = data;

+ 4 - 4
src/sched_policies/component_sched.c

@@ -412,7 +412,7 @@ struct starpu_sched_tree * starpu_sched_tree_create(unsigned sched_ctx_id)
 	STARPU_ASSERT(sched_ctx_id < STARPU_NMAX_SCHED_CTXS);
 	STARPU_ASSERT(!trees[sched_ctx_id]);
 	struct starpu_sched_tree *t;
-	STARPU_CALLOC(t, 1, sizeof(*t));
+	_STARPU_CALLOC(t, 1, sizeof(*t));
 	t->sched_ctx_id = sched_ctx_id;
 	t->workers = starpu_bitmap_create();
 	STARPU_PTHREAD_MUTEX_INIT(&t->lock,NULL);
@@ -455,7 +455,7 @@ void starpu_sched_component_add_child(struct starpu_sched_component* component,
 		STARPU_ASSERT(component->children[i] != NULL);
 	}
 
-	STARPU_REALLOC(component->children, sizeof(struct starpu_sched_component *) * (component->nchildren + 1));
+	_STARPU_REALLOC(component->children, sizeof(struct starpu_sched_component *) * (component->nchildren + 1));
 	component->children[component->nchildren] = child;
 	component->nchildren++;
 }
@@ -482,7 +482,7 @@ static void starpu_sched_component_add_parent(struct starpu_sched_component* com
 		STARPU_ASSERT(component->parents[i] != NULL);
 	}
 
-	STARPU_REALLOC(component->parents, sizeof(struct starpu_sched_component *) * (component->nparents + 1));
+	_STARPU_REALLOC(component->parents, sizeof(struct starpu_sched_component *) * (component->nparents + 1));
 	component->parents[component->nparents] = parent;
 	component->nparents++;
 }
@@ -589,7 +589,7 @@ static void take_component_and_does_nothing(struct starpu_sched_component * comp
 struct starpu_sched_component * starpu_sched_component_create(struct starpu_sched_tree *tree, const char *name)
 {
 	struct starpu_sched_component *component;
-	STARPU_CALLOC(component, 1, sizeof(*component));
+	_STARPU_CALLOC(component, 1, sizeof(*component));
 	component->tree = tree;
 	component->workers = starpu_bitmap_create();
 	component->workers_in_ctx = starpu_bitmap_create();

+ 5 - 5
src/sched_policies/component_work_stealing.c

@@ -289,18 +289,18 @@ void _ws_add_child(struct starpu_sched_component * component, struct starpu_sche
 	if(wsd->size < component->nchildren)
 	{
 		STARPU_ASSERT(wsd->size == component->nchildren - 1);
-		STARPU_REALLOC(wsd->fifos, component->nchildren * sizeof(*wsd->fifos));
-		STARPU_REALLOC(wsd->mutexes, component->nchildren * sizeof(*wsd->mutexes));
+		_STARPU_REALLOC(wsd->fifos, component->nchildren * sizeof(*wsd->fifos));
+		_STARPU_REALLOC(wsd->mutexes, component->nchildren * sizeof(*wsd->mutexes));
 		wsd->size = component->nchildren;
 	}
 
 	struct _starpu_prio_deque *fifo;
-	STARPU_MALLOC(fifo, sizeof(*fifo));
+	_STARPU_MALLOC(fifo, sizeof(*fifo));
 	_starpu_prio_deque_init(fifo);
 	wsd->fifos[component->nchildren - 1] = fifo;
 
 	starpu_pthread_mutex_t *mutex;
-	STARPU_MALLOC(mutex, sizeof(*mutex));
+	_STARPU_MALLOC(mutex, sizeof(*mutex));
 	STARPU_PTHREAD_MUTEX_INIT(mutex,NULL);
 	wsd->mutexes[component->nchildren - 1] = mutex;
 }
@@ -351,7 +351,7 @@ struct starpu_sched_component * starpu_sched_component_work_stealing_create(stru
 {
 	struct starpu_sched_component *component = starpu_sched_component_create(tree, "work_stealing");
 	struct _starpu_work_stealing_data *wsd;
-	STARPU_CALLOC(wsd, 1, sizeof(*wsd));
+	_STARPU_CALLOC(wsd, 1, sizeof(*wsd));
 	component->pull_task = pull_task;
 	component->push_task = push_task;
 	component->add_child = _ws_add_child;

+ 4 - 4
src/sched_policies/component_worker.c

@@ -134,7 +134,7 @@ static struct starpu_sched_component * _worker_components[STARPU_NMAX_SCHED_CTXS
 static struct _starpu_worker_task_list * _starpu_worker_task_list_create(void)
 {
 	struct _starpu_worker_task_list *l;
-	STARPU_MALLOC(l, sizeof(*l));
+	_STARPU_MALLOC(l, sizeof(*l));
 	memset(l, 0, sizeof(*l));
 	l->exp_len = 0.0;
 	l->exp_start = l->exp_end = starpu_timing_now();
@@ -145,7 +145,7 @@ static struct _starpu_worker_task_list * _starpu_worker_task_list_create(void)
 static struct _starpu_task_grid * _starpu_task_grid_create(void)
 {
 	struct _starpu_task_grid *t;
-	STARPU_MALLOC(t, sizeof(*t));
+	_STARPU_MALLOC(t, sizeof(*t));
 	memset(t, 0, sizeof(*t));
 	return t;
 }
@@ -592,7 +592,7 @@ static struct starpu_sched_component * starpu_sched_component_worker_create(stru
 	snprintf(name, sizeof(name), "worker %u", workerid);
 	struct starpu_sched_component * component = starpu_sched_component_create(tree, name);
 	struct _starpu_worker_component_data *data;
-	STARPU_MALLOC(data, sizeof(*data));
+	_STARPU_MALLOC(data, sizeof(*data));
 	memset(data, 0, sizeof(*data));
 
 	data->worker = worker;
@@ -776,7 +776,7 @@ static struct starpu_sched_component  * starpu_sched_component_combined_worker_c
 		return NULL;
 	struct starpu_sched_component * component = starpu_sched_component_create(tree, "combined_worker");
 	struct _starpu_worker_component_data *data;
-	STARPU_MALLOC(data, sizeof(*data));
+	_STARPU_MALLOC(data, sizeof(*data));
 	memset(data, 0, sizeof(*data));
 	data->combined_worker = combined_worker;
 	data->status = COMPONENT_STATUS_SLEEPING;

+ 4 - 4
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -916,8 +916,8 @@ static void dmda_add_workers(unsigned sched_ctx_id, int *workerids, unsigned nwo
 
 		if(dt->num_priorities != -1)
 		{
-			STARPU_MALLOC(dt->queue_array[workerid]->exp_len_per_priority, dt->num_priorities*sizeof(double));
-			STARPU_MALLOC(dt->queue_array[workerid]->ntasks_per_priority, dt->num_priorities*sizeof(unsigned));
+			_STARPU_MALLOC(dt->queue_array[workerid]->exp_len_per_priority, dt->num_priorities*sizeof(double));
+			_STARPU_MALLOC(dt->queue_array[workerid]->ntasks_per_priority, dt->num_priorities*sizeof(unsigned));
 			int j;
 			for(j = 0; j < dt->num_priorities; j++)
 			{
@@ -954,11 +954,11 @@ static void dmda_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned
 static void initialize_dmda_policy(unsigned sched_ctx_id)
 {
 	struct _starpu_dmda_data *dt;
-	STARPU_CALLOC(dt, 1, sizeof(struct _starpu_dmda_data));
+	_STARPU_CALLOC(dt, 1, sizeof(struct _starpu_dmda_data));
 
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)dt);
 
-	STARPU_MALLOC(dt->queue_array, STARPU_NMAXWORKERS*sizeof(struct _starpu_fifo_taskq*));
+	_STARPU_MALLOC(dt->queue_array, STARPU_NMAXWORKERS*sizeof(struct _starpu_fifo_taskq*));
 
 	int i;
 	for(i = 0; i < STARPU_NMAXWORKERS; i++)

+ 1 - 1
src/sched_policies/eager_central_policy.c

@@ -37,7 +37,7 @@ struct _starpu_eager_center_policy_data
 static void initialize_eager_center_policy(unsigned sched_ctx_id)
 {
 	struct _starpu_eager_center_policy_data *data;
-	STARPU_MALLOC(data, sizeof(struct _starpu_eager_center_policy_data));
+	_STARPU_MALLOC(data, sizeof(struct _starpu_eager_center_policy_data));
 
 	_STARPU_DISP("Warning: you are running the default eager scheduler, which is not a very smart scheduler. Make sure to read the StarPU documentation about adding performance models in order to be able to use the dmda or dmdas scheduler instead.\n");
 

+ 4 - 4
src/sched_policies/eager_central_priority_policy.c

@@ -58,12 +58,12 @@ static struct _starpu_priority_taskq *_starpu_create_priority_taskq(int min_prio
 {
 	struct _starpu_priority_taskq *central_queue;
 
-	STARPU_MALLOC(central_queue, sizeof(struct _starpu_priority_taskq));
+	_STARPU_MALLOC(central_queue, sizeof(struct _starpu_priority_taskq));
 	central_queue->min_prio = min_prio;
 	central_queue->max_prio = max_prio;
 	central_queue->total_ntasks = 0;
-	STARPU_MALLOC(central_queue->taskq, (max_prio-min_prio+1) * sizeof(struct starpu_task_list));
-	STARPU_MALLOC(central_queue->ntasks, (max_prio-min_prio+1) * sizeof(unsigned));
+	_STARPU_MALLOC(central_queue->taskq, (max_prio-min_prio+1) * sizeof(struct starpu_task_list));
+	_STARPU_MALLOC(central_queue->ntasks, (max_prio-min_prio+1) * sizeof(unsigned));
 
 	int prio;
 	for (prio = 0; prio < (max_prio-min_prio+1); prio++)
@@ -85,7 +85,7 @@ static void _starpu_destroy_priority_taskq(struct _starpu_priority_taskq *priori
 static void initialize_eager_center_priority_policy(unsigned sched_ctx_id)
 {
 	struct _starpu_eager_central_prio_data *data;
-	STARPU_MALLOC(data, sizeof(struct _starpu_eager_central_prio_data));
+	_STARPU_MALLOC(data, sizeof(struct _starpu_eager_central_prio_data));
 
 	/* In this policy, we support more than two levels of priority. */
 

+ 1 - 1
src/sched_policies/fifo_queues.c

@@ -44,7 +44,7 @@ static int is_sorted_task_list(struct starpu_task * task)
 struct _starpu_fifo_taskq *_starpu_create_fifo(void)
 {
 	struct _starpu_fifo_taskq *fifo;
-	STARPU_MALLOC(fifo, sizeof(struct _starpu_fifo_taskq));
+	_STARPU_MALLOC(fifo, sizeof(struct _starpu_fifo_taskq));
 
 	/* note that not all mechanisms (eg. the semaphore) have to be used */
 	starpu_task_list_init(&fifo->taskq);

+ 1 - 1
src/sched_policies/graph_test_policy.c

@@ -50,7 +50,7 @@ struct _starpu_graph_test_policy_data
 static void initialize_graph_test_policy(unsigned sched_ctx_id)
 {
 	struct _starpu_graph_test_policy_data *data;
-	STARPU_MALLOC(data, sizeof(struct _starpu_graph_test_policy_data));
+	_STARPU_MALLOC(data, sizeof(struct _starpu_graph_test_policy_data));
 
 	/* there is only a single queue in that trivial design */
 	data->fifo =  _starpu_create_fifo();

+ 1 - 1
src/sched_policies/helper_mct.c

@@ -51,7 +51,7 @@ static const float idle_power_maximum=10000.0;
 struct _starpu_mct_data *starpu_mct_init_parameters(struct starpu_sched_component_mct_data *params)
 {
 	struct _starpu_mct_data *data;
-	STARPU_MALLOC(data, sizeof(*data));
+	_STARPU_MALLOC(data, sizeof(*data));
 	if (params)
 	{
 		data->alpha = params->alpha;

+ 1 - 1
src/sched_policies/heteroprio.c

@@ -201,7 +201,7 @@ static void initialize_heteroprio_policy(unsigned sched_ctx_id)
 {
 	/* Alloc the scheduler data  */
 	struct _starpu_heteroprio_data *hp;
-	STARPU_MALLOC(hp, sizeof(struct _starpu_heteroprio_data));
+	_STARPU_MALLOC(hp, sizeof(struct _starpu_heteroprio_data));
 	memset(hp, 0, sizeof(*hp));
 
 	hp->waiters = starpu_bitmap_create();

+ 1 - 1
src/sched_policies/parallel_eager.c

@@ -121,7 +121,7 @@ static void peager_remove_workers(unsigned sched_ctx_id, int *workerids, unsigne
 static void initialize_peager_policy(unsigned sched_ctx_id)
 {
 	struct _starpu_peager_data *data;
-	STARPU_MALLOC(data, sizeof(struct _starpu_peager_data));
+	_STARPU_MALLOC(data, sizeof(struct _starpu_peager_data));
 	/* masters pick tasks from that queue */
 	data->fifo = _starpu_create_fifo();
 

+ 1 - 1
src/sched_policies/parallel_heft.c

@@ -553,7 +553,7 @@ static void parallel_heft_add_workers(__attribute__((unused)) unsigned sched_ctx
 static void initialize_parallel_heft_policy(unsigned sched_ctx_id)
 {
 	struct _starpu_pheft_data *hd;
-	STARPU_MALLOC(hd, sizeof(struct _starpu_pheft_data));
+	_STARPU_MALLOC(hd, sizeof(struct _starpu_pheft_data));
 
 	if (starpu_sched_ctx_min_priority_is_set(sched_ctx_id) == 0)
 		starpu_sched_ctx_set_min_priority(sched_ctx_id, DEFAULT_MIN_PRIORITY);

+ 1 - 1
src/sched_policies/prio_deque.c

@@ -60,7 +60,7 @@ static struct starpu_task_list * get_prio(struct _starpu_prio_deque * pdeque, in
 				break;
 	}
 	pdeque->size_array++;
-	STARPU_REALLOC(pdeque->array, sizeof(struct _starpu_prio_list) * (pdeque->size_array));
+	_STARPU_REALLOC(pdeque->array, sizeof(struct _starpu_prio_list) * (pdeque->size_array));
 	memmove(pdeque->array + i + 1,
 		pdeque->array + i,
 		(pdeque->size_array - i - 1) * sizeof(struct _starpu_prio_list));

+ 1 - 1
src/sched_policies/scheduler_maker.c

@@ -48,7 +48,7 @@ static void destroy_list(struct sched_component_list * list)
 }
 static void add_component(struct sched_component_list *list, struct starpu_sched_component * component)
 {
-	STARPU_REALLOC(list->arr, sizeof(*list->arr) * (list->size + 1));
+	_STARPU_REALLOC(list->arr, sizeof(*list->arr) * (list->size + 1));
 	list->arr[list->size] = component;
 	list->size++;
 }

+ 4 - 4
src/sched_policies/work_stealing_policy.c

@@ -267,7 +267,7 @@ static void locality_pushed_task(struct _starpu_work_stealing_data *ws, struct s
 			HASH_FIND_PTR(data->queued_tasks_per_data, &handle, entry);
 			if (STARPU_LIKELY(!entry))
 			{
-				STARPU_MALLOC(entry, sizeof(*entry));
+				_STARPU_MALLOC(entry, sizeof(*entry));
 				entry->data = handle;
 				entry->task = task;
 				HASH_ADD_PTR(data->queued_tasks_per_data, data, entry);
@@ -682,7 +682,7 @@ static void ws_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned nw
 static void initialize_ws_policy(unsigned sched_ctx_id)
 {
 	struct _starpu_work_stealing_data *ws;
-	STARPU_MALLOC(ws, sizeof(struct _starpu_work_stealing_data));
+	_STARPU_MALLOC(ws, sizeof(struct _starpu_work_stealing_data));
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)ws);
 
 	ws->last_pop_worker = 0;
@@ -692,7 +692,7 @@ static void initialize_ws_policy(unsigned sched_ctx_id)
 	ws->select_victim = select_victim;
 
 	unsigned nw = starpu_worker_get_count();
-	STARPU_CALLOC(ws->per_worker, nw, sizeof(struct _starpu_work_stealing_data_per_worker));
+	_STARPU_CALLOC(ws->per_worker, nw, sizeof(struct _starpu_work_stealing_data_per_worker));
 }
 
 static void deinit_ws_policy(unsigned sched_ctx_id)
@@ -759,7 +759,7 @@ static void lws_add_workers(unsigned sched_ctx_id, int *workerids,
 	for (i = 0; i < nworkers; i++)
 	{
 		workerid = workerids[i];
-		STARPU_MALLOC(ws->per_worker[workerid].proxlist, nworkers*sizeof(int));
+		_STARPU_MALLOC(ws->per_worker[workerid].proxlist, nworkers*sizeof(int));
 		int bindid;
 
 		struct starpu_tree *neighbour = NULL;

+ 33 - 33
src/top/starpu_top.c

@@ -70,7 +70,7 @@ void copy_data_and_param(void)
 {
 	printf("%s:%d trace\n", __FILE__, __LINE__);
 	//copying datas
-	STARPU_MALLOC(starpu_top_datas, starpu_top_data_cpt*sizeof(struct starpu_top_data*));
+	_STARPU_MALLOC(starpu_top_datas, starpu_top_data_cpt*sizeof(struct starpu_top_data*));
 	struct starpu_top_data* cur = starpu_top_first_data;
 	unsigned int i = 0;
 	for(i = 0; i < starpu_top_data_cpt; i++)
@@ -79,7 +79,7 @@ void copy_data_and_param(void)
 		cur = cur->next;
 	}
 	//copying params
-	STARPU_MALLOC(starpu_top_params, starpu_top_param_cpt*sizeof(struct starpu_top_param*));
+	_STARPU_MALLOC(starpu_top_params, starpu_top_param_cpt*sizeof(struct starpu_top_param*));
 	struct starpu_top_param* cur2 = starpu_top_first_param;
 	for(i = 0; i < starpu_top_param_cpt; i++)
 	{
@@ -118,14 +118,14 @@ static void starpu_top_get_device_type(int id, char* type)
 static void starpu_top_send_devices_info(void)
 {
 	char *message;
-	STARPU_MALLOC(message, 5*sizeof(char));
+	_STARPU_MALLOC(message, 5*sizeof(char));
 	snprintf(message,5,"DEV\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
 
 	unsigned int i;
 	for(i=0;i<starpu_worker_get_count();i++)
 	{
-		STARPU_MALLOC(message, sizeof(char)*128);
+		_STARPU_MALLOC(message, sizeof(char)*128);
 		char dev_type[10];
 		char dev_name[64];
 		starpu_top_get_device_type(i,dev_type);
@@ -134,7 +134,7 @@ static void starpu_top_send_devices_info(void)
 		_starpu_top_message_add(_starpu_top_mt,message);
 	}
 
-	STARPU_MALLOC(message, 6*sizeof(char));
+	_STARPU_MALLOC(message, 6*sizeof(char));
 	snprintf(message,6,"/DEV\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
 }
@@ -160,22 +160,22 @@ void starpu_top_init_and_wait(const char* server_name)
 
 	//sending server information (report to protocol)
 	char *message;
-	STARPU_MALLOC(message, strlen("SERVERINFO\n")+1);
+	_STARPU_MALLOC(message, strlen("SERVERINFO\n")+1);
 	sprintf(message, "%s", "SERVERINFO\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
-	STARPU_MALLOC(message, strlen(server_name)+2);
+	_STARPU_MALLOC(message, strlen(server_name)+2);
 	sprintf(message, "%s\n", server_name);
 	_starpu_top_message_add(_starpu_top_mt,message);
-	STARPU_MALLOC(message, 25);
+	_STARPU_MALLOC(message, 25);
 	sprintf(message, "%llu\n", current_timestamp());
 	_starpu_top_message_add(_starpu_top_mt,message);
-	STARPU_MALLOC(message, strlen("/SERVERINFO\n")+1);
+	_STARPU_MALLOC(message, strlen("/SERVERINFO\n")+1);
 	sprintf(message,"%s", "/SERVERINFO\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
 
 
 	//sending data list
-	STARPU_MALLOC(message, strlen("DATA\n")+1);
+	_STARPU_MALLOC(message, strlen("DATA\n")+1);
 	sprintf(message, "%s", "DATA\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
 	struct starpu_top_data * cur_data = starpu_top_first_data;
@@ -184,12 +184,12 @@ void starpu_top_init_and_wait(const char* server_name)
 		_starpu_top_message_add(_starpu_top_mt,message_for_topdata_init(cur_data));
 		cur_data = cur_data->next;
 	}
-	STARPU_MALLOC(message, strlen("/DATA\n")+1);
+	_STARPU_MALLOC(message, strlen("/DATA\n")+1);
 	sprintf(message, "%s", "/DATA\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
 
 	//sending parameter list
-	STARPU_MALLOC(message, strlen("PARAMS\n")+1);
+	_STARPU_MALLOC(message, strlen("PARAMS\n")+1);
 	sprintf(message, "%s", "PARAMS\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
 	struct starpu_top_param * cur_param = starpu_top_first_param;
@@ -200,7 +200,7 @@ void starpu_top_init_and_wait(const char* server_name)
 	  cur_param = cur_param->next;
 	}
 	printf("%s:%d parameters sended\n", __FILE__, __LINE__);
-	STARPU_MALLOC(message, strlen("/PARAMS\n")+1);
+	_STARPU_MALLOC(message, strlen("/PARAMS\n")+1);
 	sprintf(message, "%s", "/PARAMS\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
 
@@ -213,7 +213,7 @@ void starpu_top_init_and_wait(const char* server_name)
 	copy_data_and_param();
 
 	//sending READY message
-	STARPU_MALLOC(message, strlen("READY\n")+1);
+	_STARPU_MALLOC(message, strlen("READY\n")+1);
 	sprintf(message, "%s", "READY\n");
 	_starpu_top_message_add(_starpu_top_mt,message);
 
@@ -265,7 +265,7 @@ struct starpu_top_data * starpu_top_add_data_boolean(const char* data_name,
 						     int active)
 {
 	struct starpu_top_data *data;
-	STARPU_MALLOC(data, sizeof(struct starpu_top_data));
+	_STARPU_MALLOC(data, sizeof(struct starpu_top_data));
 	data->id = starpu_top_data_cpt++;
 	data->name = data_name;
 	data->type = STARPU_TOP_DATA_BOOLEAN;
@@ -283,7 +283,7 @@ struct starpu_top_data * starpu_top_add_data_integer(const char* data_name,
 						     int active)
 {
 	struct starpu_top_data *data;
-	STARPU_MALLOC(data, sizeof(struct starpu_top_data));
+	_STARPU_MALLOC(data, sizeof(struct starpu_top_data));
 	data->id = starpu_top_data_cpt++;
 	data->name = data_name;
 	data->type = STARPU_TOP_DATA_INTEGER;
@@ -303,7 +303,7 @@ struct starpu_top_data* starpu_top_add_data_float(const char* data_name,
 						  int active)
 {
 	struct starpu_top_data *data;
-	STARPU_MALLOC(data, sizeof(struct starpu_top_data));
+	_STARPU_MALLOC(data, sizeof(struct starpu_top_data));
 	data->id = starpu_top_data_cpt++;
 	data->name = data_name;
 	data->type = STARPU_TOP_DATA_FLOAT;
@@ -320,7 +320,7 @@ struct starpu_top_data* starpu_top_add_data_float(const char* data_name,
 char *message_for_topdata_init(struct starpu_top_data* data)
 {
 	char *message;
-	STARPU_MALLOC(message, 256+strlen(data->name));
+	_STARPU_MALLOC(message, 256+strlen(data->name));
 	switch(data->type)
 	{
 		case STARPU_TOP_DATA_BOOLEAN:
@@ -360,7 +360,7 @@ char *message_for_topparam_init(struct starpu_top_param* param)
 	switch(param->type)
 	{
 	case STARPU_TOP_PARAM_BOOLEAN:
-		STARPU_MALLOC(message, 256);
+		_STARPU_MALLOC(message, 256);
 		sprintf(message,
 				"BOOL;%u;%s;%d\n",
 				param->id,
@@ -368,7 +368,7 @@ char *message_for_topparam_init(struct starpu_top_param* param)
 				(*(int*)(param->value)) ? 1 : 0);
 		break;
 	case STARPU_TOP_PARAM_INTEGER:
-		STARPU_MALLOC(message, 256);
+		_STARPU_MALLOC(message, 256);
 		sprintf(message,
 				"INT;%u;%s;%d;%d;%d\n",param->id,
 				param->name,
@@ -377,7 +377,7 @@ char *message_for_topparam_init(struct starpu_top_param* param)
 				*(int*)(param->value));
 		break;
 	case STARPU_TOP_PARAM_FLOAT:
-		STARPU_MALLOC(message, 256);
+		_STARPU_MALLOC(message, 256);
 		sprintf(message,
 				"FLOAT;%u;%s;%f;%f;%f\n",
 				param->id,
@@ -392,7 +392,7 @@ char *message_for_topparam_init(struct starpu_top_param* param)
 		{
 			length += strlen(param->enum_values[i])+1;
 		}
-		STARPU_MALLOC(message, 256+length);
+		_STARPU_MALLOC(message, 256+length);
 		sprintf(message,
 				"ENUM;%u;%s;",
 				param->id,
@@ -438,7 +438,7 @@ struct starpu_top_param* starpu_top_register_parameter_boolean(const char* param
 {
 	STARPU_ASSERT(!_starpu_top_status_get());
 	struct starpu_top_param *param;
-	STARPU_MALLOC(param, sizeof(struct starpu_top_param));
+	_STARPU_MALLOC(param, sizeof(struct starpu_top_param));
 	param->callback = callback;
 	param->name = param_name;
 	param->id = starpu_top_param_cpt++;
@@ -459,7 +459,7 @@ struct starpu_top_param* starpu_top_register_parameter_integer(const char* param
 {
 	STARPU_ASSERT(!_starpu_top_status_get());
 	struct starpu_top_param *param;
-	STARPU_MALLOC(param, sizeof(struct starpu_top_param));
+	_STARPU_MALLOC(param, sizeof(struct starpu_top_param));
 	param->callback = callback;
 	param->name = param_name;
 	param->id = starpu_top_param_cpt++;
@@ -482,7 +482,7 @@ struct starpu_top_param* starpu_top_register_parameter_float(const char* param_n
 {
 	STARPU_ASSERT(!_starpu_top_status_get());
 	struct starpu_top_param *param;
-	STARPU_MALLOC(param, sizeof(struct starpu_top_param));
+	_STARPU_MALLOC(param, sizeof(struct starpu_top_param));
 	param->callback = callback;
 	param->name = param_name;
 	param->id = starpu_top_param_cpt++;
@@ -505,7 +505,7 @@ struct starpu_top_param* starpu_top_register_parameter_enum(const char* param_na
 {
 	STARPU_ASSERT(!_starpu_top_status_get());
 	struct starpu_top_param *param;
-	STARPU_MALLOC(param, sizeof(struct starpu_top_param));
+	_STARPU_MALLOC(param, sizeof(struct starpu_top_param));
 	param->callback = callback;
 	param->name = param_name;
 	param->id = starpu_top_param_cpt++;
@@ -530,7 +530,7 @@ void starpu_top_update_data_boolean(const struct starpu_top_data* data, int valu
 	if(data->active)
 	{
 		char *message;
-		STARPU_MALLOC(message, 256+strlen(data->name));
+		_STARPU_MALLOC(message, 256+strlen(data->name));
 		sprintf(message,
 				"U;%u;%d;%llu\n",
 				data->id,
@@ -547,7 +547,7 @@ void starpu_top_update_data_integer(const struct starpu_top_data* data, int valu
 	if(data->active)
 	{
 		char *message;
-		STARPU_MALLOC(message, 256+strlen(data->name));
+		_STARPU_MALLOC(message, 256+strlen(data->name));
 		sprintf(message,
 				"U;%u;%d;%llu\n",
 				data->id,
@@ -564,7 +564,7 @@ void starpu_top_update_data_float(const struct starpu_top_data* data, double val
 	if(data->active)
 	{
 		char *message;
-		STARPU_MALLOC(message, 256+strlen(data->name));
+		_STARPU_MALLOC(message, 256+strlen(data->name));
 		sprintf(message,
 				"U;%u;%f;%llu\n",
 				data->id, value,
@@ -578,7 +578,7 @@ void starpu_top_update_parameter(const struct starpu_top_param* param)
 	if (!_starpu_top_status_get())
 		return;
 	char *message;
-	STARPU_MALLOC(message, 50);
+	_STARPU_MALLOC(message, 50);
 
 	switch(param->type)
 	{
@@ -614,7 +614,7 @@ void starpu_top_debug_log(const char* debug_message)
 	{
 		//length can be up to strlen*2, if message contains only unwanted chars
 		char *message;
-		STARPU_MALLOC(message, strlen(debug_message)*2+16);
+		_STARPU_MALLOC(message, strlen(debug_message)*2+16);
 		sprintf(message,"MESSAGE;");
 
 		//escape unwanted char : ; and \n
@@ -643,7 +643,7 @@ void starpu_top_debug_lock(const char* debug_message)
 	if(starpu_top_debug_on)
 	{
 		char *message;
-		STARPU_MALLOC(message, strlen(debug_message)*2+16);
+		_STARPU_MALLOC(message, strlen(debug_message)*2+16);
 		sprintf(message,"LOCK;");
 		char* cur = message+5;
 		while(*debug_message!='\0')
@@ -778,7 +778,7 @@ void starpu_top_change_debug_mode(const char*message)
 	}
 
 	char *m;
-	STARPU_MALLOC(m, strlen(message)+1);
+	_STARPU_MALLOC(m, strlen(message)+1);
 	sprintf(m,"%s",message);
 	_starpu_top_message_add(_starpu_top_mt,m);
 }

+ 1 - 1
src/top/starpu_top_message_queue.c

@@ -100,7 +100,7 @@ char* _starpu_top_message_remove(struct _starpu_top_message_queue* s)
 struct _starpu_top_message_queue* _starpu_top_message_queue_new(void)
 {
 	struct _starpu_top_message_queue *p;
-	STARPU_MALLOC(p, sizeof(*p));
+	_STARPU_MALLOC(p, sizeof(*p));
 
 	p->head = p->tail = NULL;
 	sem_init(&(p->semaphore),0,0);

+ 3 - 3
src/top/starpu_top_task.c

@@ -35,7 +35,7 @@ void _starpu_top_task_started(struct starpu_task *task,
 	unsigned long long taskid = _starpu_get_job_associated_to_task(task)->job_id;
 	STARPU_ASSERT(_starpu_top_status_get());
 	char *str;
-	STARPU_MALLOC(str, sizeof(char)*64);
+	_STARPU_MALLOC(str, sizeof(char)*64);
 	snprintf(str, 64,
 				"START;%llu;%d;%llu\n",
 				taskid,
@@ -53,7 +53,7 @@ void _starpu_top_task_ended(struct starpu_task *task,
 	(void) devid; //unused
 	STARPU_ASSERT(_starpu_top_status_get());
 	char *str;
-	STARPU_MALLOC(str, sizeof(char)*64);
+	_STARPU_MALLOC(str, sizeof(char)*64);
 	snprintf(str, 64,
 				"END;%llu;%llu\n",
 				taskid,
@@ -86,7 +86,7 @@ void starpu_top_task_prevision(struct starpu_task *task,
 	struct timespec now;
 	_starpu_clock_gettime(&now);
 	char *str;
-	STARPU_MALLOC(str, sizeof(char)*200);
+	_STARPU_MALLOC(str, sizeof(char)*200);
 	snprintf(str, 128,
 		 "PREV;%llu;%d;%llu;%llu;%llu\n",
 		 taskid,

+ 5 - 5
src/util/fstarpu.c

@@ -162,7 +162,7 @@ intptr_t fstarpu_get_constant(char *s)
 struct starpu_conf *fstarpu_conf_allocate(void)
 {
 	struct starpu_conf *conf;
-	STARPU_MALLOC(conf, sizeof(*conf));
+	_STARPU_MALLOC(conf, sizeof(*conf));
 	starpu_conf_init(conf);
 	return conf;
 }
@@ -238,7 +238,7 @@ void fstarpu_topology_print(void)
 struct starpu_codelet *fstarpu_codelet_allocate(void)
 {
 	struct starpu_codelet *cl;
-	STARPU_MALLOC(cl, sizeof(*cl));
+	_STARPU_MALLOC(cl, sizeof(*cl));
 	starpu_codelet_init(cl);
 	return cl;
 }
@@ -545,7 +545,7 @@ void fstarpu_worker_get_type_as_string(intptr_t type, char *dst, size_t maxlen)
 struct starpu_data_handle *fstarpu_data_handle_array_alloc(int nb)
 {
 	void *ptr;
-	STARPU_CALLOC(ptr, (size_t)nb, sizeof(starpu_data_handle_t));
+	_STARPU_CALLOC(ptr, (size_t)nb, sizeof(starpu_data_handle_t));
 	return ptr;
 }
 
@@ -562,7 +562,7 @@ void fstarpu_data_handle_array_set(starpu_data_handle_t *handles, int i, starpu_
 struct starpu_data_descr *fstarpu_data_descr_array_alloc(int nb)
 {
 	void *ptr;
-	STARPU_CALLOC(ptr, (size_t)nb, sizeof(struct starpu_data_descr));
+	_STARPU_CALLOC(ptr, (size_t)nb, sizeof(struct starpu_data_descr));
 	return ptr;
 }
 
@@ -595,7 +595,7 @@ void fstarpu_data_descr_set(struct starpu_data_descr *descr, starpu_data_handle_
 struct starpu_data_filter *fstarpu_data_filter_allocate(void)
 {
 	struct starpu_data_filter *filter;
-	STARPU_CALLOC(filter, 1, sizeof(*filter));
+	_STARPU_CALLOC(filter, 1, sizeof(*filter));
 	return filter;
 }
 

+ 22 - 22
src/util/openmp_runtime_support.c

@@ -263,7 +263,7 @@ static struct starpu_omp_critical *create_omp_critical_struct(void)
 {
 	struct starpu_omp_critical *critical;
 
-	STARPU_CALLOC(critical, 1, sizeof(*critical));
+	_STARPU_CALLOC(critical, 1, sizeof(*critical));
 	_starpu_spin_init(&critical->lock);
 	return critical;
 }
@@ -281,7 +281,7 @@ static struct starpu_omp_device *create_omp_device_struct(void)
 {
 	struct starpu_omp_device *device;
 
-	STARPU_CALLOC(device, 1, sizeof(*device));
+	_STARPU_CALLOC(device, 1, sizeof(*device));
 	_starpu_spin_init(&device->atomic_lock);
 	return device;
 }
@@ -314,7 +314,7 @@ static struct starpu_omp_region *create_omp_region_struct(struct starpu_omp_regi
 {
 	struct starpu_omp_region *region;
 
-	STARPU_CALLOC(region, 1, sizeof(*region));
+	_STARPU_CALLOC(region, 1, sizeof(*region));
 	region->parent_region = parent_region;
 	region->owner_device = owner_device;
 	starpu_omp_thread_list_init(&region->thread_list);
@@ -468,7 +468,7 @@ static void starpu_omp_implicit_task_exec(void *buffers[], void *cl_arg)
 		task->starpu_cl_arg = cl_arg;
 		STARPU_ASSERT(task->stack == NULL);
 		STARPU_ASSERT(task->stacksize > 0);
-		STARPU_MALLOC(task->stack, task->stacksize);
+		_STARPU_MALLOC(task->stack, task->stacksize);
 		getcontext(&task->ctx);
 		/*
 		 * we do not use uc_link, starpu_omp_task_entry will handle
@@ -636,7 +636,7 @@ static void starpu_omp_explicit_task_exec(void *buffers[], void *cl_arg)
 		task->starpu_cl_arg = cl_arg;
 		STARPU_ASSERT(task->stack == NULL);
 		STARPU_ASSERT(task->stacksize > 0);
-		STARPU_MALLOC(task->stack, task->stacksize);
+		_STARPU_MALLOC(task->stack, task->stacksize);
 		getcontext(&task->ctx);
 		/*
 		 * we do not use uc_link, starpu_omp_task_entry will handle
@@ -731,7 +731,7 @@ static void omp_initial_thread_setup(void)
 	initial_thread->current_task = initial_task;
 	/* .owner_region already set in create_omp_thread_struct */
 	/* .initial_thread_stack */
-	STARPU_MALLOC(initial_thread->initial_thread_stack, _STARPU_INITIAL_THREAD_STACKSIZE);
+	_STARPU_MALLOC(initial_thread->initial_thread_stack, _STARPU_INITIAL_THREAD_STACKSIZE);
 	if (initial_thread->initial_thread_stack == NULL)
 		_STARPU_ERROR("memory allocation failed");
 	/* .ctx */
@@ -764,7 +764,7 @@ static void omp_initial_thread_setup(void)
 	_starpu_omp_set_task(initial_task);
 
 	_global_state.nb_starpu_cpu_workers = starpu_worker_get_count_by_type(STARPU_CPU_WORKER);
-	STARPU_MALLOC(_global_state.starpu_cpu_worker_ids, _global_state.nb_starpu_cpu_workers * sizeof(int));
+	_STARPU_MALLOC(_global_state.starpu_cpu_worker_ids, _global_state.nb_starpu_cpu_workers * sizeof(int));
 	if (_global_state.starpu_cpu_worker_ids == NULL)
 		_STARPU_ERROR("memory allocation failed");
 	ret = starpu_worker_get_ids_by_type(STARPU_CPU_WORKER, _global_state.starpu_cpu_worker_ids, _global_state.nb_starpu_cpu_workers);
@@ -834,7 +834,7 @@ static void omp_initial_region_setup(void)
 	_global_state.initial_region->icvs.nest_var = _starpu_omp_initial_icv_values->nest_var;
 	if (_starpu_omp_initial_icv_values->nthreads_var[1] != 0)
 	{
-		STARPU_MALLOC(_global_state.initial_region->icvs.nthreads_var, (1+max_active_levels-_global_state.initial_region->level) * sizeof(*_global_state.initial_region->icvs.nthreads_var));
+		_STARPU_MALLOC(_global_state.initial_region->icvs.nthreads_var, (1+max_active_levels-_global_state.initial_region->level) * sizeof(*_global_state.initial_region->icvs.nthreads_var));
 		int i,j;
 		for (i = _global_state.initial_region->level, j = 0; i < max_active_levels; i++, j++)
 		{
@@ -844,14 +844,14 @@ static void omp_initial_region_setup(void)
 	}
 	else
 	{
-		STARPU_MALLOC(_global_state.initial_region->icvs.nthreads_var, 2 * sizeof(*_global_state.initial_region->icvs.nthreads_var));
+		_STARPU_MALLOC(_global_state.initial_region->icvs.nthreads_var, 2 * sizeof(*_global_state.initial_region->icvs.nthreads_var));
 		_global_state.initial_region->icvs.nthreads_var[0] = _starpu_omp_initial_icv_values->nthreads_var[0];
 		_global_state.initial_region->icvs.nthreads_var[1] = 0;
 	}
 
 	if (_starpu_omp_initial_icv_values->bind_var[1] != starpu_omp_proc_bind_undefined)
 	{
-		STARPU_MALLOC(_global_state.initial_region->icvs.bind_var, (1+max_active_levels-_global_state.initial_region->level) * sizeof(*_global_state.initial_region->icvs.bind_var));
+		_STARPU_MALLOC(_global_state.initial_region->icvs.bind_var, (1+max_active_levels-_global_state.initial_region->level) * sizeof(*_global_state.initial_region->icvs.bind_var));
 		int i,j;
 		for (i = _global_state.initial_region->level, j = 0; i < max_active_levels; i++, j++)
 		{
@@ -861,7 +861,7 @@ static void omp_initial_region_setup(void)
 	}
 	else
 	{
-		STARPU_MALLOC(_global_state.initial_region->icvs.bind_var, 2 * sizeof(*_global_state.initial_region->icvs.bind_var));
+		_STARPU_MALLOC(_global_state.initial_region->icvs.bind_var, 2 * sizeof(*_global_state.initial_region->icvs.bind_var));
 		_global_state.initial_region->icvs.bind_var[0] = _starpu_omp_initial_icv_values->bind_var[0];
 		_global_state.initial_region->icvs.bind_var[1] = starpu_omp_proc_bind_undefined;
 	}
@@ -1038,7 +1038,7 @@ void starpu_omp_parallel_region(const struct starpu_omp_parallel_region_attr *at
 	{
 		if (generating_region->icvs.nthreads_var[1] != 0)
 		{
-			STARPU_MALLOC(new_region->icvs.nthreads_var, (1+max_active_levels-new_region->level) * sizeof(*new_region->icvs.nthreads_var));
+			_STARPU_MALLOC(new_region->icvs.nthreads_var, (1+max_active_levels-new_region->level) * sizeof(*new_region->icvs.nthreads_var));
 			int i,j;
 			for (i = new_region->level, j = 0; i < max_active_levels; i++, j++)
 			{
@@ -1048,14 +1048,14 @@ void starpu_omp_parallel_region(const struct starpu_omp_parallel_region_attr *at
 		}
 		else
 		{
-			STARPU_MALLOC(new_region->icvs.nthreads_var, 2 * sizeof(*new_region->icvs.nthreads_var));
+			_STARPU_MALLOC(new_region->icvs.nthreads_var, 2 * sizeof(*new_region->icvs.nthreads_var));
 			new_region->icvs.nthreads_var[0] = generating_region->icvs.nthreads_var[0];
 			new_region->icvs.nthreads_var[1] = 0;
 		}
 
 		if (generating_region->icvs.bind_var[1] != starpu_omp_proc_bind_undefined)
 		{
-			STARPU_MALLOC(new_region->icvs.bind_var, (1+max_active_levels-new_region->level) * sizeof(*new_region->icvs.bind_var));
+			_STARPU_MALLOC(new_region->icvs.bind_var, (1+max_active_levels-new_region->level) * sizeof(*new_region->icvs.bind_var));
 			int i,j;
 			for (i = new_region->level, j = 0; i < max_active_levels; i++, j++)
 			{
@@ -1065,17 +1065,17 @@ void starpu_omp_parallel_region(const struct starpu_omp_parallel_region_attr *at
 		}
 		else
 		{
-			STARPU_MALLOC(new_region->icvs.bind_var, 2 * sizeof(*new_region->icvs.bind_var));
+			_STARPU_MALLOC(new_region->icvs.bind_var, 2 * sizeof(*new_region->icvs.bind_var));
 			new_region->icvs.bind_var[0] = generating_region->icvs.bind_var[0];
 			new_region->icvs.bind_var[1] = starpu_omp_proc_bind_undefined;
 		}
 	}
 	else
 	{
-		STARPU_MALLOC(new_region->icvs.nthreads_var, sizeof(*new_region->icvs.nthreads_var));
+		_STARPU_MALLOC(new_region->icvs.nthreads_var, sizeof(*new_region->icvs.nthreads_var));
 		new_region->icvs.nthreads_var[0] = generating_region->icvs.nthreads_var[0];
 
-		STARPU_MALLOC(new_region->icvs.bind_var, sizeof(*new_region->icvs.bind_var));
+		_STARPU_MALLOC(new_region->icvs.bind_var, sizeof(*new_region->icvs.bind_var));
 		new_region->icvs.bind_var[0] = generating_region->icvs.bind_var[0];
 	}
 	new_region->icvs.thread_limit_var = generating_region->icvs.thread_limit_var;
@@ -1753,7 +1753,7 @@ void starpu_omp_taskgroup_inline_begin(void)
 {
 	struct starpu_omp_task *task = _starpu_omp_get_task();
 	struct starpu_omp_task_group *p_task_group;
-	STARPU_MALLOC(p_task_group, sizeof(*p_task_group));
+	_STARPU_MALLOC(p_task_group, sizeof(*p_task_group));
 	p_task_group->p_previous_task_group = task->task_group;
 	p_task_group->descendent_task_count = 0;
 	p_task_group->leader_task = task;
@@ -1936,7 +1936,7 @@ static inline struct starpu_omp_loop *_starpu_omp_for_loop_begin(struct starpu_o
 	loop = _starpu_omp_for_get_loop(parallel_region, task);
 	if (!loop)
 	{
-		STARPU_MALLOC(loop, sizeof(*loop));
+		_STARPU_MALLOC(loop, sizeof(*loop));
 		loop->id = task->loop_id;
 		loop->next_iteration = 0;
 		loop->nb_completed_threads = 0;
@@ -2113,7 +2113,7 @@ static inline struct starpu_omp_sections *_starpu_omp_sections_begin(struct star
 	sections = _starpu_omp_get_sections(parallel_region, task);
 	if (!sections)
 	{
-		STARPU_MALLOC(sections, sizeof(*sections));
+		_STARPU_MALLOC(sections, sizeof(*sections));
 		sections->id = task->sections_id;
 		sections->next_section_num = 0;
 		sections->nb_completed_threads = 0;
@@ -2207,7 +2207,7 @@ static void _starpu_omp_lock_init(void **_internal)
 {
 	struct _starpu_omp_lock_internal *_lock;
 
-	STARPU_CALLOC(_lock, 1, sizeof(*_lock));
+	_STARPU_CALLOC(_lock, 1, sizeof(*_lock));
 	_starpu_spin_init(&_lock->lock);
 	condition_init(&_lock->cond);
 	*_internal = _lock;
@@ -2264,7 +2264,7 @@ static void _starpu_omp_nest_lock_init(void **_internal)
 {
 	struct _starpu_omp_nest_lock_internal *_nest_lock;
 
-	STARPU_CALLOC(_nest_lock, 1, sizeof(*_nest_lock));
+	_STARPU_CALLOC(_nest_lock, 1, sizeof(*_nest_lock));
 	_starpu_spin_init(&_nest_lock->lock);
 	condition_init(&_nest_lock->cond);
 	*_internal = _nest_lock;

+ 8 - 8
src/util/openmp_runtime_support_environment.c

@@ -402,12 +402,12 @@ static void read_a_places_list(const char *str, struct starpu_omp_place *places)
 						if (excluded_items_list_size == 0)
 						{
 							excluded_items_list_size = _STARPU_INITIAL_PLACE_ITEMS_LIST_SIZE;
-							STARPU_MALLOC(excluded_items_list, excluded_items_list_size * sizeof(int));
+							_STARPU_MALLOC(excluded_items_list, excluded_items_list_size * sizeof(int));
 						}
 						else if (nb_excluded_items == excluded_items_list_size)
 						{
 							excluded_items_list_size *= 2;
-							STARPU_REALLOC(excluded_items_list, excluded_items_list_size * sizeof(int));
+							_STARPU_REALLOC(excluded_items_list, excluded_items_list_size * sizeof(int));
 						}
 						excluded_items_list[nb_excluded_items] = v;
 						nb_excluded_items++;
@@ -417,12 +417,12 @@ static void read_a_places_list(const char *str, struct starpu_omp_place *places)
 						if (included_items_list_size == 0)
 						{
 							included_items_list_size = _STARPU_INITIAL_PLACE_ITEMS_LIST_SIZE;
-							STARPU_MALLOC(included_items_list, included_items_list_size * sizeof(int));
+							_STARPU_MALLOC(included_items_list, included_items_list_size * sizeof(int));
 						}
 						else if (nb_included_items == included_items_list_size)
 						{
 							included_items_list_size *= 2;
-							STARPU_REALLOC(included_items_list, included_items_list_size * sizeof(int));
+							_STARPU_REALLOC(included_items_list, included_items_list_size * sizeof(int));
 						}
 						included_items_list[nb_included_items] = v;
 						nb_included_items++;
@@ -454,12 +454,12 @@ static void read_a_places_list(const char *str, struct starpu_omp_place *places)
 				if (places_list_size == 0)
 				{
 					places_list_size = _STARPU_INITIAL_PLACES_LIST_SIZE;
-					STARPU_MALLOC(places_list, places_list_size * sizeof(*places_list));
+					_STARPU_MALLOC(places_list, places_list_size * sizeof(*places_list));
 				}
 				else if (nb_places == places_list_size)
 				{
 					places_list_size *= 2;
-					STARPU_REALLOC(places_list, places_list_size * sizeof(*places_list));
+					_STARPU_REALLOC(places_list, places_list_size * sizeof(*places_list));
 				}
 				places_list[nb_places].excluded_place = exclude_place_flag;
 				places_list[nb_places].included_numeric_items = included_items_list;
@@ -545,7 +545,7 @@ static void read_proc_bind_var()
 	int level = 0;
 	char *env;
 
-	STARPU_CALLOC(bind_list, max_levels, sizeof(*bind_list));
+	_STARPU_CALLOC(bind_list, max_levels, sizeof(*bind_list));
 
 	env = starpu_getenv("OMP_PROC_BIND");
 	if (env)
@@ -575,7 +575,7 @@ static void read_num_threads_var()
 	int level = 0;
 	char *env;
 
-	STARPU_CALLOC(num_threads_list, max_levels, sizeof(*num_threads_list));
+	_STARPU_CALLOC(num_threads_list, max_levels, sizeof(*num_threads_list));
 
 	env = starpu_getenv("OMP_NUM_THREADS");
 	if (env)

+ 11 - 11
src/util/starpu_clusters_create.c

@@ -97,9 +97,9 @@ struct starpu_cluster_machine *starpu_cluster_machine(hwloc_obj_type_t cluster_l
 	int arg_type;
 	struct _starpu_cluster_parameters *params;
 	struct starpu_cluster_machine *machine;
-	STARPU_MALLOC(machine, sizeof(struct starpu_cluster_machine));
+	_STARPU_MALLOC(machine, sizeof(struct starpu_cluster_machine));
 
-	STARPU_MALLOC(machine->params, sizeof(struct _starpu_cluster_parameters));
+	_STARPU_MALLOC(machine->params, sizeof(struct _starpu_cluster_parameters));
 	machine->id = STARPU_NMAX_SCHED_CTXS;
 	machine->groups = _starpu_cluster_group_list_new();
 	machine->nclusters = 0;
@@ -342,7 +342,7 @@ void _starpu_cluster_group_init(struct _starpu_cluster_group *group,
 	group->nclusters = 0;
 	group->clusters = _starpu_cluster_list_new();
 	group->father = father;
-	STARPU_MALLOC(group->params, sizeof(struct _starpu_cluster_parameters));
+	_STARPU_MALLOC(group->params, sizeof(struct _starpu_cluster_parameters));
 	_starpu_cluster_copy_parameters(group->params, father->params);
 	return;
 }
@@ -356,7 +356,7 @@ void _starpu_cluster_init(struct _starpu_cluster *cluster,
 	cluster->cores = NULL;
 	cluster->workerids = NULL;
 	cluster->father = father;
-	STARPU_MALLOC(cluster->params, sizeof(struct _starpu_cluster_parameters));
+	_STARPU_MALLOC(cluster->params, sizeof(struct _starpu_cluster_parameters));
 	_starpu_cluster_copy_parameters(cluster->params, father->params);
 }
 
@@ -540,7 +540,7 @@ int _starpu_cluster_topology(hwloc_obj_type_t cluster_level,
 	if (nworkers == 0)
 		return -ENODEV;
 	int *workers;
-	STARPU_MALLOC(workers, sizeof(int) * nworkers);
+	_STARPU_MALLOC(workers, sizeof(int) * nworkers);
 	starpu_worker_get_ids_by_type(STARPU_CPU_WORKER, workers, nworkers);
 
 	struct _starpu_machine_config *config = _starpu_get_machine_config();
@@ -628,8 +628,8 @@ void _starpu_cluster(struct _starpu_cluster_group *group)
 
 		if (cluster->ncores > 0)
 		{
-			STARPU_MALLOC(cluster->cores, sizeof(int)*cluster->ncores);
-			STARPU_MALLOC(cluster->workerids, sizeof(int)*cluster->ncores);
+			_STARPU_MALLOC(cluster->cores, sizeof(int)*cluster->ncores);
+			_STARPU_MALLOC(cluster->workerids, sizeof(int)*cluster->ncores);
 			avail_pus -= cluster->ncores;
 			npreset++;
 		}
@@ -660,8 +660,8 @@ void _starpu_cluster(struct _starpu_cluster_group *group)
 					avail_pus/(group->nclusters-i);
 		}
 		avail_pus -= cluster->ncores;
-		STARPU_MALLOC(cluster->cores, sizeof(int)*cluster->ncores);
-		STARPU_MALLOC(cluster->workerids, sizeof(int)*cluster->ncores);
+		_STARPU_MALLOC(cluster->cores, sizeof(int)*cluster->ncores);
+		_STARPU_MALLOC(cluster->workerids, sizeof(int)*cluster->ncores);
 
 		cluster = _starpu_cluster_list_next(cluster);
 	}
@@ -699,8 +699,8 @@ void _starpu_cluster(struct _starpu_cluster_group *group)
 				starpu_cluster_warned = 1;
 			}
 			cluster->ncores += size-1;
-			STARPU_REALLOC(cluster->cores, sizeof(int)*cluster->ncores);
-			STARPU_REALLOC(cluster->workerids, sizeof(int)*cluster->ncores);
+			_STARPU_REALLOC(cluster->cores, sizeof(int)*cluster->ncores);
+			_STARPU_REALLOC(cluster->workerids, sizeof(int)*cluster->ncores);
 		}
 
 		/* grab workerid list and return first cpu */

+ 1 - 1
src/util/starpu_data_cpy.c

@@ -153,7 +153,7 @@ int _starpu_data_cpy(starpu_data_handle_t dst_handle, starpu_data_handle_t src_h
 	task->cl = &copy_cl;
 
 	unsigned *interface_id;
-	STARPU_MALLOC(interface_id, sizeof(*interface_id));
+	_STARPU_MALLOC(interface_id, sizeof(*interface_id));
 	*interface_id = dst_handle->ops->interfaceid; 
 	task->cl_arg = interface_id;
 	task->cl_arg_size = sizeof(*interface_id);

+ 5 - 5
src/util/starpu_task_insert_utils.c

@@ -30,7 +30,7 @@ static void _starpu_pack_arguments(size_t *current_offset, size_t *arg_buffer_si
 			*arg_buffer_size_ = 128 + sizeof(ptr_size) + ptr_size;
 		else
 			*arg_buffer_size_ = 2 * *arg_buffer_size_ + sizeof(ptr_size) + ptr_size;
-		STARPU_REALLOC(*arg_buffer_, *arg_buffer_size_);
+		_STARPU_REALLOC(*arg_buffer_, *arg_buffer_size_);
 	}
 	memcpy(*arg_buffer_+*current_offset, (void *)&ptr_size, sizeof(ptr_size));
 	*current_offset += sizeof(ptr_size);
@@ -186,14 +186,14 @@ void _starpu_task_insert_check_nb_buffers(struct starpu_codelet *cl, struct star
 			int i;
 			struct starpu_codelet *cl2 = (*task)->cl;
 			*allocated_buffers = STARPU_NMAXBUFS * 2;
-			STARPU_MALLOC((*task)->dyn_handles, *allocated_buffers * sizeof(starpu_data_handle_t));
+			_STARPU_MALLOC((*task)->dyn_handles, *allocated_buffers * sizeof(starpu_data_handle_t));
 			for(i=0 ; i<current_buffer ; i++)
 			{
 				(*task)->dyn_handles[i] = (*task)->handles[i];
 			}
 			if (cl2->nbuffers == STARPU_VARIABLE_NBUFFERS || !cl2->dyn_modes)
 			{
-				STARPU_MALLOC((*task)->dyn_modes, *allocated_buffers * sizeof(enum starpu_data_access_mode));
+				_STARPU_MALLOC((*task)->dyn_modes, *allocated_buffers * sizeof(enum starpu_data_access_mode));
 				for(i=0 ; i<current_buffer ; i++)
 				{
 					(*task)->dyn_modes[i] = (*task)->modes[i];
@@ -203,10 +203,10 @@ void _starpu_task_insert_check_nb_buffers(struct starpu_codelet *cl, struct star
 		else if (current_buffer >= *allocated_buffers)
 		{
 			*allocated_buffers *= 2;
-			STARPU_REALLOC((*task)->dyn_handles, *allocated_buffers * sizeof(starpu_data_handle_t));
+			_STARPU_REALLOC((*task)->dyn_handles, *allocated_buffers * sizeof(starpu_data_handle_t));
 			if (cl->nbuffers == STARPU_VARIABLE_NBUFFERS || !cl->dyn_modes)
 			{
-				STARPU_REALLOC((*task)->dyn_modes, *allocated_buffers * sizeof(enum starpu_data_access_mode));
+				_STARPU_REALLOC((*task)->dyn_modes, *allocated_buffers * sizeof(enum starpu_data_access_mode));
 			}
 		}
 	}

+ 3 - 3
src/worker_collection/worker_list.c

@@ -238,9 +238,9 @@ static void list_init(struct starpu_worker_collection *workers)
 	int *unblocked_workers;
 	int *masters;
 
-	STARPU_MALLOC(workerids, (STARPU_NMAXWORKERS+STARPU_NMAX_COMBINEDWORKERS) * sizeof(int));
-	STARPU_MALLOC(unblocked_workers, (STARPU_NMAXWORKERS+STARPU_NMAX_COMBINEDWORKERS) * sizeof(int));
-	STARPU_MALLOC(masters, (STARPU_NMAXWORKERS+STARPU_NMAX_COMBINEDWORKERS) * sizeof(int));
+	_STARPU_MALLOC(workerids, (STARPU_NMAXWORKERS+STARPU_NMAX_COMBINEDWORKERS) * sizeof(int));
+	_STARPU_MALLOC(unblocked_workers, (STARPU_NMAXWORKERS+STARPU_NMAX_COMBINEDWORKERS) * sizeof(int));
+	_STARPU_MALLOC(masters, (STARPU_NMAXWORKERS+STARPU_NMAX_COMBINEDWORKERS) * sizeof(int));
 	_init_workers(workerids);
 	_init_workers(unblocked_workers);
 	_init_workers(masters);

+ 1 - 1
src/worker_collection/worker_tree.c

@@ -287,7 +287,7 @@ static int tree_remove(struct starpu_worker_collection *workers, int worker)
 
 static void tree_init(struct starpu_worker_collection *workers)
 {
-	STARPU_MALLOC(workers->workerids, (STARPU_NMAXWORKERS+STARPU_NMAX_COMBINEDWORKERS) * sizeof(int));
+	_STARPU_MALLOC(workers->workerids, (STARPU_NMAXWORKERS+STARPU_NMAX_COMBINEDWORKERS) * sizeof(int));
 	workers->collection_private = (void*)starpu_workers_get_tree();
 	workers->nworkers = 0;