Function rmw_service_endpoint_info_array_fini

Function Documentation

rmw_ret_t rmw_service_endpoint_info_array_fini(rmw_service_endpoint_info_array_t *service_endpoint_info_array, rcutils_allocator_t *allocator)

Finalize an array of service endpoint information.

This function deallocates the given array storage, and then zero initializes it. If a logical error, such as RMW_RET_INVALID_ARGUMENT, ensues, this function will return early, leaving the given array unchanged. Otherwise, it will proceed despite errors.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Remark

This function sets the RMW error state on failure.

Thread-safety

Finalization is a reentrant procedure, but:

  • Access to the array of service endpoint information is not synchronized. It is not safe to read or write service_endpoint_info_array during finalization.

  • The default allocators are thread-safe objects, but any custom allocator may not be. Check your allocator documentation for further reference.

Parameters:
  • service_endpoint_info_array[inout] object to be finalized.

  • allocator[in] Allocator used to populate the given service_endpoint_info_array.

Pre:

Given allocator must be the same used to initialize the given service_endpoint_info_array.

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if service_endpoint_info_array is NULL, or

Returns:

RMW_RET_INVALID_ARGUMENT if allocator is invalid, by rcutils_allocator_is_valid() definition, or

Returns:

RMW_RET_ERROR when an unspecified error occurs.