mirror of
https://github.com/esphome/esphome.git
synced 2025-08-01 07:57:47 +00:00
Merge branch 'integration' into memory_api
This commit is contained in:
commit
23f0c596c2
@ -1727,6 +1727,8 @@ void APIConnection::process_batch_() {
|
|||||||
uint16_t proto_payload_size = payload_size - header_padding - footer_size;
|
uint16_t proto_payload_size = payload_size - header_padding - footer_size;
|
||||||
// Use placement new to construct PacketInfo in pre-allocated stack array
|
// Use placement new to construct PacketInfo in pre-allocated stack array
|
||||||
// This avoids default-constructing all MAX_PACKETS_PER_BATCH elements
|
// This avoids default-constructing all MAX_PACKETS_PER_BATCH elements
|
||||||
|
// Explicit destruction is not needed because PacketInfo is trivially destructible,
|
||||||
|
// as ensured by the static_assert in its definition.
|
||||||
new (&packet_info[packet_count++]) PacketInfo(item.message_type, current_offset, proto_payload_size);
|
new (&packet_info[packet_count++]) PacketInfo(item.message_type, current_offset, proto_payload_size);
|
||||||
|
|
||||||
// Update tracking variables
|
// Update tracking variables
|
||||||
|
Loading…
x
Reference in New Issue
Block a user