@@ -335,7 +335,7 @@ static void free_pb_type(t_pb_type* pb_type) {
335
335
for (int m = 0 ; m < pb_type->modes [i].interconnect [j].annotations [k].num_value_prop_pairs ; ++m) {
336
336
vtr::free (pb_type->modes [i].interconnect [j].annotations [k].value [m]);
337
337
}
338
- vtr::free ( pb_type->modes [i].interconnect [j].annotations [k].prop ) ;
338
+ delete[] pb_type->modes [i].interconnect [j].annotations [k].prop ;
339
339
vtr::free (pb_type->modes [i].interconnect [j].annotations [k].value );
340
340
}
341
341
vtr::free (pb_type->modes [i].interconnect [j].annotations );
@@ -355,7 +355,7 @@ static void free_pb_type(t_pb_type* pb_type) {
355
355
vtr::free (pb_type->annotations [i].value [j]);
356
356
}
357
357
vtr::free (pb_type->annotations [i].value );
358
- vtr::free ( pb_type->annotations [i].prop ) ;
358
+ delete[] pb_type->annotations [i].prop ;
359
359
if (pb_type->annotations [i].input_pins ) {
360
360
vtr::free (pb_type->annotations [i].input_pins );
361
361
}
@@ -367,7 +367,7 @@ static void free_pb_type(t_pb_type* pb_type) {
367
367
}
368
368
}
369
369
if (pb_type->num_annotations > 0 ) {
370
- vtr::free ( pb_type->annotations ) ;
370
+ delete[] pb_type->annotations ;
371
371
}
372
372
373
373
if (pb_type->pb_type_power ) {
@@ -527,7 +527,7 @@ void alloc_and_load_default_child_for_pb_type(t_pb_type* pb_type,
527
527
}
528
528
}
529
529
530
- copy->annotations = ( t_pin_to_pin_annotation*) vtr::calloc ( pb_type->num_annotations , sizeof (t_pin_to_pin_annotation) );
530
+ copy->annotations = new t_pin_to_pin_annotation[ pb_type->num_annotations ]( );
531
531
copy->num_annotations = pb_type->num_annotations ;
532
532
for (i = 0 ; i < copy->num_annotations ; i++) {
533
533
copy->annotations [i].clock = vtr::strdup (pb_type->annotations [i].clock );
@@ -549,7 +549,7 @@ void alloc_and_load_default_child_for_pb_type(t_pb_type* pb_type,
549
549
copy->annotations [i].format = pb_type->annotations [i].format ;
550
550
copy->annotations [i].type = pb_type->annotations [i].type ;
551
551
copy->annotations [i].num_value_prop_pairs = pb_type->annotations [i].num_value_prop_pairs ;
552
- copy->annotations [i].prop = ( int *) vtr::malloc ( sizeof ( int ) * pb_type->annotations [i].num_value_prop_pairs ) ;
552
+ copy->annotations [i].prop = new int [ pb_type->annotations [i].num_value_prop_pairs ] ;
553
553
copy->annotations [i].value = (char **)vtr::malloc (sizeof (char *) * pb_type->annotations [i].num_value_prop_pairs );
554
554
for (j = 0 ; j < pb_type->annotations [i].num_value_prop_pairs ; j++) {
555
555
copy->annotations [i].prop [j] = pb_type->annotations [i].prop [j];
@@ -627,8 +627,7 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
627
627
lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].format = lut_pb_type->annotations [i].format ;
628
628
lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].type = lut_pb_type->annotations [i].type ;
629
629
lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].num_value_prop_pairs = lut_pb_type->annotations [i].num_value_prop_pairs ;
630
- lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].prop = (int *)vtr::malloc (sizeof (int )
631
- * lut_pb_type->annotations [i].num_value_prop_pairs );
630
+ lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].prop = new int [lut_pb_type->annotations [i].num_value_prop_pairs ];
632
631
lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].value = (char **)vtr::malloc (sizeof (char *)
633
632
* lut_pb_type->annotations [i].num_value_prop_pairs );
634
633
for (j = 0 ; j < lut_pb_type->annotations [i].num_value_prop_pairs ; j++) {
@@ -654,7 +653,7 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
654
653
free (lut_pb_type->annotations [i].value [j]);
655
654
}
656
655
free (lut_pb_type->annotations [i].value );
657
- free ( lut_pb_type->annotations [i].prop ) ;
656
+ delete[] lut_pb_type->annotations [i].prop ;
658
657
if (lut_pb_type->annotations [i].input_pins ) {
659
658
free (lut_pb_type->annotations [i].input_pins );
660
659
}
@@ -666,7 +665,7 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
666
665
}
667
666
}
668
667
lut_pb_type->num_annotations = 0 ;
669
- free ( lut_pb_type->annotations ) ;
668
+ delete[] lut_pb_type->annotations ;
670
669
lut_pb_type->annotations = nullptr ;
671
670
lut_pb_type->modes [1 ].pb_type_children [0 ].depth = lut_pb_type->depth + 1 ;
672
671
lut_pb_type->modes [1 ].pb_type_children [0 ].parent_mode = &lut_pb_type->modes [1 ];
@@ -944,7 +943,7 @@ void SyncModelsPbTypes_rec(t_arch* arch,
944
943
945
944
pb_type->model_id = model_match_prim_id;
946
945
vtr::t_linked_vptr* old = model_match_prim.pb_types ;
947
- model_match_prim.pb_types = ( vtr::t_linked_vptr*) vtr::malloc ( sizeof (vtr::t_linked_vptr)) ;
946
+ model_match_prim.pb_types = new vtr::t_linked_vptr;
948
947
model_match_prim.pb_types ->next = old;
949
948
model_match_prim.pb_types ->data_vptr = pb_type;
950
949
0 commit comments