File tree Expand file tree Collapse file tree 4 files changed +8
-15
lines changed
rosidl_generator_c/resource Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -456,10 +456,8 @@ bool
456
456
if (output-> capacity < input-> size) {
457
457
const size_t allocation_size =
458
458
input-> size * sizeof (@ (message_typename));
459
- rcutils_allocator_t allocator = rcutils_get_default_allocator ();
460
459
@ (message_typename) * data =
461
- (@ (message_typename) * )allocator .reallocate (
462
- output-> data, allocation_size, allocator .state );
460
+ (@ (message_typename) * )realloc (output-> data, allocation_size);
463
461
if (! data) {
464
462
return false ;
465
463
}
469
467
for (; i-- > output-> capacity; ) {
470
468
@ (message_typename)__fini (& data[i]);
471
469
}
472
- allocator . deallocate (data, allocator . state );
470
+ free (data);
473
471
return false ;
474
472
}
475
473
}
Original file line number Diff line number Diff line change 85
85
return false; \
86
86
} \
87
87
if (output->capacity < input->size) { \
88
- rcutils_allocator_t allocator = rcutils_get_default_allocator(); \
89
- TYPE_NAME * data = (TYPE_NAME *)allocator.reallocate( \
90
- output->data, sizeof(TYPE_NAME) * input->size, allocator.state); \
88
+ TYPE_NAME * data = (TYPE_NAME *)realloc( \
89
+ output->data, sizeof(TYPE_NAME) * input->size); \
91
90
if (!data) { \
92
91
return false; \
93
92
} \
Original file line number Diff line number Diff line change @@ -229,10 +229,8 @@ rosidl_runtime_c__String__Sequence__copy(
229
229
if (output -> capacity < input -> size ) {
230
230
const size_t allocation_size =
231
231
input -> size * sizeof (rosidl_runtime_c__String );
232
- rcutils_allocator_t allocator = rcutils_get_default_allocator ();
233
232
rosidl_runtime_c__String * data =
234
- (rosidl_runtime_c__String * )allocator .reallocate (
235
- output -> data , allocation_size , allocator .state );
233
+ (rosidl_runtime_c__String * )realloc (output -> data , allocation_size );
236
234
if (!data ) {
237
235
return false;
238
236
}
@@ -242,7 +240,7 @@ rosidl_runtime_c__String__Sequence__copy(
242
240
for (; i -- > output -> capacity ; ) {
243
241
rosidl_runtime_c__String__fini (& data [i ]);
244
242
}
245
- allocator . deallocate (data , allocator . state );
243
+ free (data );
246
244
return false;
247
245
}
248
246
}
Original file line number Diff line number Diff line change @@ -272,10 +272,8 @@ rosidl_runtime_c__U16String__Sequence__copy(
272
272
if (output -> capacity < input -> size ) {
273
273
const size_t size =
274
274
input -> size * sizeof (rosidl_runtime_c__U16String );
275
- rcutils_allocator_t allocator = rcutils_get_default_allocator ();
276
275
rosidl_runtime_c__U16String * data =
277
- (rosidl_runtime_c__U16String * )allocator .reallocate (
278
- output -> data , size , allocator .state );
276
+ (rosidl_runtime_c__U16String * )realloc (output -> data , size );
279
277
if (!data ) {
280
278
return false;
281
279
}
@@ -285,7 +283,7 @@ rosidl_runtime_c__U16String__Sequence__copy(
285
283
for (; i -- > output -> capacity ; ) {
286
284
rosidl_runtime_c__U16String__fini (& data [i ]);
287
285
}
288
- allocator . deallocate (data , allocator . state );
286
+ free (data );
289
287
return false;
290
288
}
291
289
}
You can’t perform that action at this time.
0 commit comments