mirror of
https://github.com/danog/ir.git
synced 2024-11-26 20:34:53 +01:00
Replace calloc() by malloc()
This commit is contained in:
parent
b344d2ee0f
commit
dce017f0ed
7
ir_cfg.c
7
ir_cfg.c
@ -430,10 +430,12 @@ int ir_find_loops(ir_ctx *ctx)
|
||||
/* We don't materialize the DJ spanning tree explicitly, as we are only interested in ancestor
|
||||
* queries. These are implemented by checking entry/exit times of the DFS search. */
|
||||
ir_worklist_init(&work, ctx->cfg_blocks_count + 1);
|
||||
entry_times = ir_mem_calloc((ctx->cfg_blocks_count + 1) * 3, sizeof(uint32_t));
|
||||
entry_times = ir_mem_malloc((ctx->cfg_blocks_count + 1) * 3 * sizeof(uint32_t));
|
||||
exit_times = entry_times + ctx->cfg_blocks_count + 1;
|
||||
sorted_blocks = exit_times + ctx->cfg_blocks_count + 1;
|
||||
|
||||
memset(entry_times, 0, (ctx->cfg_blocks_count + 1) * sizeof(uint32_t));
|
||||
|
||||
ir_worklist_push(&work, 1);
|
||||
while (ir_worklist_len(&work)) {
|
||||
ir_block *bb;
|
||||
@ -694,8 +696,9 @@ int ir_schedule_blocks(ir_ctx *ctx)
|
||||
}
|
||||
|
||||
if (reorder) {
|
||||
ir_block *cfg_blocks = ir_mem_calloc(sizeof(ir_block), ctx->cfg_blocks_count + 1);
|
||||
ir_block *cfg_blocks = ir_mem_malloc(sizeof(ir_block) * (ctx->cfg_blocks_count + 1));
|
||||
|
||||
memset(ctx->cfg_blocks, 0, sizeof(ir_block));
|
||||
for (b = 1, bb = cfg_blocks + 1; b <= count; b++, bb++) {
|
||||
*bb = ctx->cfg_blocks[list[b]];
|
||||
if (bb->dom_parent > 0) {
|
||||
|
@ -449,7 +449,7 @@ void ir_array_remove(ir_array *a, uint32_t i);
|
||||
|
||||
IR_ALWAYS_INLINE void ir_array_init(ir_array *a, uint32_t size)
|
||||
{
|
||||
a->refs = ir_mem_calloc(size, sizeof(ir_ref));
|
||||
a->refs = ir_mem_malloc(size * sizeof(ir_ref));
|
||||
a->size = size;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user