Skip to content

Commit

Permalink
fixup! Optimize PublisherData::publish
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz committed Nov 20, 2024
1 parent 27e096e commit 29725e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/detail/serialization_buffer_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SerializationBufferPool
std::lock_guard<std::mutex> guard(mutex_);

if (available_buffers_.empty()) {
uint8_t *data = static_cast<uint8_t *>(allocator->allocate(size, allocator->state));
uint8_t * data = static_cast<uint8_t *>(allocator->allocate(size, allocator->state));
assert(data); // FIXME(fuzzypixelz): handle error
SerializationBuffer buffer;
buffer.data = data;
Expand All @@ -42,8 +42,8 @@ class SerializationBufferPool
SerializationBuffer buffer = buffers_.at(available_buffers_.back());
available_buffers_.pop_back();
if (buffer.size < size) {
buffer.data = static_cast<uint8_t *>(allocator->reallocate(buffer.data, size,
allocator->state));
buffer.data = static_cast<uint8_t *>(allocator->reallocate(
buffer.data, size, allocator->state));
assert(buffer.data); // FIXME(fuzzypixelz): handle error
buffer.size = size;
}
Expand Down

0 comments on commit 29725e1

Please sign in to comment.