Skip to content

Commit 67a6a54

Browse files
authored
Merge branch 'master' into namespace_node_secure_root
2 parents d15b1c1 + 1120b2f commit 67a6a54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1959
-1426
lines changed

rcl/include/rcl/arguments.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ rcl_remove_ros_arguments(
242242
* Uses Atomics | No
243243
* Lock-Free | Yes
244244
*
245-
* \param[in] error_alloc an alocator to use if an error occurs.
246-
* This allocator is not used to allocate args_out.
247245
* \param[in] args The structure to be copied.
248246
* Its allocator is used to copy memory into the new structure.
249247
* \param[out] args_out A zero-initialized arguments structure to be copied into.
@@ -256,7 +254,6 @@ RCL_PUBLIC
256254
RCL_WARN_UNUSED
257255
rcl_ret_t
258256
rcl_arguments_copy(
259-
rcl_allocator_t error_alloc,
260257
const rcl_arguments_t * args,
261258
rcl_arguments_t * args_out);
262259

rcl/include/rcl/client.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ RCL_WARN_UNUSED
5555
rcl_client_t
5656
rcl_get_zero_initialized_client(void);
5757

58-
5958
/// Initialize a rcl client.
6059
/**
6160
* After calling this function on a rcl_client_t, it can be used to send
@@ -378,7 +377,7 @@ rcl_client_get_rmw_handle(const rcl_client_t * client);
378377

379378
/// Check that the client is valid.
380379
/**
381-
* The bool returned is `false` if client is invalid
380+
* The bool returned is `false` if client is invalid.
382381
* The bool returned is `true` otherwise.
383382
* In the case where `false` is to be returned, an error message is set.
384383
* This function cannot fail.
@@ -392,12 +391,11 @@ rcl_client_get_rmw_handle(const rcl_client_t * client);
392391
* Lock-Free | Yes
393392
*
394393
* \param[in] client pointer to the rcl client
395-
* \param[in] error_msg_allocator a valid allocator or `NULL`
396394
* \return `true` if `client` is valid, otherwise `false`
397395
*/
398396
RCL_PUBLIC
399397
bool
400-
rcl_client_is_valid(const rcl_client_t * client, rcl_allocator_t * error_msg_allocator);
398+
rcl_client_is_valid(const rcl_client_t * client);
401399

402400
#ifdef __cplusplus
403401
}

rcl/include/rcl/error_handling.h

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,32 @@
1818
#include "rcutils/error_handling.h"
1919

2020
/// The error handling in RCL is just an alias to the error handling in rcutils.
21-
/**
22-
* Allocators given to functions in rcl are passed along to the error handling
23-
* on a "best effort" basis.
24-
* In some situations, like when NULL is passed for the allocator or something
25-
* else that contains it, the allocator is not available to be passed to the
26-
* RCL_SET_ERROR_MSG macro.
27-
* In these cases, the default allocator rcl_get_default_allocator() is used.
28-
* Since these are considered fatal errors, as opposed to errors that might
29-
* occur during normal runtime, is should be okay to use the default allocator.
30-
*/
3121

3222
typedef rcutils_error_state_t rcl_error_state_t;
23+
typedef rcutils_error_string_t rcl_error_string_t;
3324

34-
#define rcl_error_state_copy rcutils_error_state_copy
35-
36-
#define rcl_error_state_fini rcutils_error_state_fini
25+
#define rcl_initialize_error_handling_thread_local_storage \
26+
rcutils_initialize_error_handling_thread_local_storage
3727

3828
#define rcl_set_error_state rcutils_set_error_state
3929

40-
#define RCL_CHECK_ARGUMENT_FOR_NULL(argument, error_return_type, allocator) \
41-
RCUTILS_CHECK_ARGUMENT_FOR_NULL(argument, error_return_type, allocator)
30+
#define RCL_CHECK_ARGUMENT_FOR_NULL(argument, error_return_type) \
31+
RCUTILS_CHECK_ARGUMENT_FOR_NULL(argument, error_return_type)
4232

43-
#define RCL_CHECK_FOR_NULL_WITH_MSG(value, msg, error_statement, allocator) \
44-
RCUTILS_CHECK_FOR_NULL_WITH_MSG(value, msg, error_statement, allocator)
33+
#define RCL_CHECK_FOR_NULL_WITH_MSG(value, msg, error_statement) \
34+
RCUTILS_CHECK_FOR_NULL_WITH_MSG(value, msg, error_statement)
4535

46-
#define RCL_SET_ERROR_MSG(msg, allocator) RCUTILS_SET_ERROR_MSG(msg, allocator)
36+
#define RCL_SET_ERROR_MSG(msg) RCUTILS_SET_ERROR_MSG(msg)
4737

48-
#define RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, fmt_str, ...) \
49-
RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, fmt_str, __VA_ARGS__)
38+
#define RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(fmt_str, ...) \
39+
RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING(fmt_str, __VA_ARGS__)
5040

5141
#define rcl_error_is_set rcutils_error_is_set
5242

5343
#define rcl_get_error_state rcutils_get_error_state
5444

5545
#define rcl_get_error_string rcutils_get_error_string
5646

57-
#define rcl_get_error_string_safe rcutils_get_error_string_safe
58-
5947
#define rcl_reset_error rcutils_reset_error
6048

6149
#endif // RCL__ERROR_HANDLING_H_

rcl/include/rcl/lexer.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,23 @@ typedef enum rcl_lexeme_t
8787
* <hr>
8888
* Attribute | Adherence
8989
* ------------------ | -------------
90-
* Allocates Memory | Yes [1]
90+
* Allocates Memory | No
9191
* Thread-Safe | Yes
9292
* Uses Atomics | No
9393
* Lock-Free | Yes
94-
* <i>[1] Only allocates if an argument is invalid or an internal bug is detected.</i>
9594
*
9695
* \param[in] text The string to analyze.
97-
* \param[in] allocator An allocator to use if an error occurs.
9896
* \param[out] lexeme The type of lexeme found in the string.
9997
* \param[out] length The length of text in the string that constitutes the found lexeme.
10098
* \return `RCL_RET_OK` if analysis is successful regardless whether a valid lexeme is found, or
10199
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
102-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
103100
* \return `RCL_RET_ERROR` if an internal bug is detected.
104101
*/
105102
RCL_PUBLIC
106103
RCL_WARN_UNUSED
107104
rcl_ret_t
108105
rcl_lexer_analyze(
109106
const char * text,
110-
rcl_allocator_t allocator,
111107
rcl_lexeme_t * lexeme,
112108
size_t * length);
113109

rcl/include/rcl/node.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ rcl_node_get_default_options(void);
220220
* Uses Atomics | No
221221
* Lock-Free | Yes
222222
*
223-
* \param[in] error_alloc an alocator to use if an error occurs.
224-
* This allocator is not used to allocate the output.
225223
* \param[in] options The structure to be copied.
226224
* Its allocator is used to copy memory into the new structure.
227225
* \param[out] options_out An options structure containing default values.
@@ -234,18 +232,13 @@ RCL_PUBLIC
234232
RCL_WARN_UNUSED
235233
rcl_ret_t
236234
rcl_node_options_copy(
237-
rcl_allocator_t error_alloc,
238235
const rcl_node_options_t * options,
239236
rcl_node_options_t * options_out);
240237

241238
/// Return `true` if the node is valid, else `false`.
242239
/**
243240
* Also return `false` if the node pointer is `NULL` or the allocator is invalid.
244241
*
245-
* The allocator needs to either be a valid allocator or `NULL`, in which case
246-
* the default allocator will be used.
247-
* The allocator is used when allocation is needed for an error message.
248-
*
249242
* A node is invalid if:
250243
* - the implementation is `NULL` (rcl_node_init not called or failed)
251244
* - rcl_shutdown has been called since the node has been initialized
@@ -256,7 +249,7 @@ rcl_node_options_copy(
256249
* Consider:
257250
*
258251
* ```c
259-
* assert(rcl_node_is_valid(node, NULL)); // <-- thread 1
252+
* assert(rcl_node_is_valid(node)); // <-- thread 1
260253
* rcl_shutdown(); // <-- thread 2
261254
* // use node as if valid // <-- thread 1
262255
* ```
@@ -275,12 +268,11 @@ rcl_node_options_copy(
275268
* <i>[1] if `atomic_is_lock_free()` returns true for `atomic_uint_least64_t`</i>
276269
*
277270
* \param[in] node rcl_node_t to be validated
278-
* \param[in] error_msg_allocator a valid allocator or `NULL`
279271
* \return `true` if the node and allocator are valid, otherwise `false`.
280272
*/
281273
RCL_PUBLIC
282274
bool
283-
rcl_node_is_valid(const rcl_node_t * node, rcl_allocator_t * error_msg_allocator);
275+
rcl_node_is_valid(const rcl_node_t * node);
284276

285277
/// Return the name of the node.
286278
/**

rcl/include/rcl/publisher.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ rcl_publisher_get_rmw_handle(const rcl_publisher_t * publisher);
378378
/**
379379
* The bool returned is `false` if `publisher` is invalid.
380380
* The bool returned is `true` otherwise.
381-
* In the case where `false` is to be returned, an
382-
* error message is set.
381+
* In the case where `false` is to be returned, an error message is set.
383382
* This function cannot fail.
384383
*
385384
* <hr>
@@ -391,14 +390,11 @@ rcl_publisher_get_rmw_handle(const rcl_publisher_t * publisher);
391390
* Lock-Free | Yes
392391
*
393392
* \param[in] publisher pointer to the rcl publisher
394-
* \param[in] error_msg_allocator a valid allocator or `NULL`
395393
* \return `true` if `publisher` is valid, otherwise `false`
396394
*/
397395
RCL_PUBLIC
398396
bool
399-
rcl_publisher_is_valid(
400-
const rcl_publisher_t * publisher,
401-
rcl_allocator_t * error_msg_allocator);
397+
rcl_publisher_is_valid(const rcl_publisher_t * publisher);
402398

403399
#ifdef __cplusplus
404400
}

rcl/include/rcl/service.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,7 @@ rcl_service_get_rmw_handle(const rcl_service_t * service);
391391
/**
392392
* The bool returned is `false` if `service` is invalid.
393393
* The bool returned is `true` otherwise.
394-
* In the case where `false` is to be returned, an
395-
* error message is set.
394+
* In the case where `false` is to be returned, an error message is set.
396395
* This function cannot fail.
397396
*
398397
* <hr>
@@ -404,12 +403,11 @@ rcl_service_get_rmw_handle(const rcl_service_t * service);
404403
* Lock-Free | Yes
405404
*
406405
* \param[in] service pointer to the rcl service
407-
* \param[in] error_msg_allocator a valid allocator or `NULL`
408406
* \return `true` if `service` is valid, otherwise `false`
409407
*/
410408
RCL_PUBLIC
411409
bool
412-
rcl_service_is_valid(const rcl_service_t * service, rcl_allocator_t * error_msg_allocator);
410+
rcl_service_is_valid(const rcl_service_t * service);
413411

414412
#ifdef __cplusplus
415413
}

rcl/include/rcl/subscription.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,7 @@ rcl_subscription_get_rmw_handle(const rcl_subscription_t * subscription);
388388
/**
389389
* The bool returned is `false` if `subscription` is invalid.
390390
* The bool returned is `true` otherwise.
391-
* In the case where `false` is to be returned, an
392-
* error message is set.
391+
* In the case where `false` is to be returned, an error message is set.
393392
* This function cannot fail.
394393
*
395394
* <hr>
@@ -401,14 +400,11 @@ rcl_subscription_get_rmw_handle(const rcl_subscription_t * subscription);
401400
* Lock-Free | Yes
402401
*
403402
* \param[in] subscription pointer to the rcl subscription
404-
* \param[in] error_msg_allocator a valid allocator or `NULL`
405403
* \return `true` if `subscription` is valid, otherwise `false`
406404
*/
407405
RCL_PUBLIC
408406
bool
409-
rcl_subscription_is_valid(
410-
const rcl_subscription_t * subscription,
411-
rcl_allocator_t * error_msg_allocator);
407+
rcl_subscription_is_valid(const rcl_subscription_t * subscription);
412408

413409
#ifdef __cplusplus
414410
}

0 commit comments

Comments
 (0)