Skip to content

Commit b398323

Browse files
Move the responsibility of pointer zeroing to the caller
1 parent 030ebab commit b398323

File tree

18 files changed

+19
-19
lines changed

18 files changed

+19
-19
lines changed

rclc/include/rclc/executor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ rclc_executor_t *
10031003
rclc_alloc_zero_initialized_executor(const rcl_allocator_t * const allocator);
10041004

10051005
/**
1006-
* De-allocates an rclc_executor_t object and sets the pointer to NULL.
1006+
* De-allocates an rclc_executor_t object.
10071007
*
10081008
* * <hr>
10091009
* Attribute | Adherence

rclc/include/rclc/init.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ rclc_get_context(
144144
rclc_support_t * support);
145145

146146
/**
147-
* De-allocates the rclc_support_t object and sets the pointer to NULL.
147+
* De-allocates an rclc_support_t object.
148148
*
149149
* * <hr>
150150
* Attribute | Adherence
@@ -166,8 +166,7 @@ rclc_support_free(
166166

167167

168168
/**
169-
* Allocates the rcl_allocator_t object on the heap and sets it with default
170-
* values.
169+
* Allocates the rcl_allocator_t object and sets it to default values.
171170
* Can be used as an alternative to rcl_get_default_allocator() if no
172171
* stack allocation can or should be used.
173172
*
@@ -187,7 +186,7 @@ rcl_allocator_t *
187186
rclc_allocator_alloc_default();
188187

189188
/**
190-
* De-allocates the rcl_allocator_t object and sets the pointer to NULL.
189+
* De-allocates an rcl_allocator_t object.
191190
*
192191
* * <hr>
193192
* Attribute | Adherence

rclc/include/rclc/node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ rcl_node_t *
100100
rclc_alloc_zero_initialized_node(const rcl_allocator_t * const allocator);
101101

102102
/**
103-
* De-allocates an rcl_node_t object and sets the pointer to NULL.
103+
* De-allocates an rcl_node_t object.
104104
*
105105
* * <hr>
106106
* Attribute | Adherence

rclc/include/rclc/publisher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ rclc_publisher_alloc(
130130
const rcl_allocator_t * const allocator);
131131

132132
/**
133-
* De-allocates an rcl_publisher_t object and sets the pointer to NULL.
133+
* De-allocates an rcl_publisher_t object.
134134
*
135135
* * <hr>
136136
* Attribute | Adherence

rclc/include/rclc/subscription.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ rclc_alloc_zero_initialized_subscription(
131131
);
132132

133133
/**
134-
* De-allocates an rcl_subscription_t object and sets the pointer to NULL.
134+
* De-allocates an rcl_subscription_t object.
135135
*
136136
* * <hr>
137137
* Attribute | Adherence

rclc/include/rclc/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ rclc_alloc_zero_initialized_timer(
7575
);
7676

7777
/**
78-
* De-allocates an rcl_timer_t object and sets the pointer to NULL.
78+
* De-allocates an rcl_timer_t object.
7979
*
8080
* * <hr>
8181
* Attribute | Adherence

rclc/src/rclc/executor.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,6 +2137,5 @@ rclc_executor_free(rclc_executor_t * executor)
21372137
RCL_CHECK_FOR_NULL_WITH_MSG(
21382138
executor, "executor is a null pointer", return RCL_RET_INVALID_ARGUMENT);
21392139
executor->allocator->deallocate(executor, executor->allocator->state);
2140-
executor = NULL;
21412140
return RCL_RET_OK;
21422141
}

rclc/src/rclc/init.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ rclc_support_free(rclc_support_t * support, const rcl_allocator_t * const alloca
124124
RCL_CHECK_FOR_NULL_WITH_MSG(
125125
support, "support is a null pointer", return RCL_RET_INVALID_ARGUMENT);
126126
allocator->deallocate(support, allocator->state);
127-
support = NULL;
128127
return RCL_RET_OK;
129128
}
130129

@@ -156,7 +155,6 @@ rclc_allocator_free(rcl_allocator_t * allocator)
156155
RCL_CHECK_FOR_NULL_WITH_MSG(
157156
allocator, "allocator is a null pointer", return RCL_RET_INVALID_ARGUMENT);
158157
allocator->deallocate(allocator, allocator->state);
159-
allocator = NULL;
160158
return RCL_RET_OK;
161159
}
162160

rclc/src/rclc/node.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,5 @@ rclc_node_free(rcl_node_t * node, const rcl_allocator_t * const allocator)
102102
RCL_CHECK_FOR_NULL_WITH_MSG(
103103
node, "node is a null pointer", return RCL_RET_INVALID_ARGUMENT);
104104
allocator->deallocate(node, allocator->state);
105-
node = NULL;
106105
return RCL_RET_OK;
107106
}

rclc/src/rclc/publisher.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,5 @@ rclc_publisher_free(
9898
RCL_CHECK_FOR_NULL_WITH_MSG(
9999
publisher, "publisher is a null pointer", return RCL_RET_INVALID_ARGUMENT);
100100
allocator->deallocate(publisher, allocator->state);
101-
publisher = NULL;
102101
return RCL_RET_OK;
103102
}

0 commit comments

Comments
 (0)