From 4641f73d19cba2fc4e148f01393fc4d9a3407fbd Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 11 Jun 2025 11:19:36 -0500 Subject: [PATCH] comments --- esphome/components/esp32_ble/ble_event.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esphome/components/esp32_ble/ble_event.h b/esphome/components/esp32_ble/ble_event.h index a29d668f4d..86eaadfc13 100644 --- a/esphome/components/esp32_ble/ble_event.h +++ b/esphome/components/esp32_ble/ble_event.h @@ -86,6 +86,8 @@ class BLEEvent { this->event_.gattc.gattc_if = i; // Allocate external storage for param and data + // External allocation is used because GATTC/GATTS events are rare (<1% of events) + // while GAP events (99%) are stored inline to minimize memory usage this->event_.gattc.gattc_param = new esp_ble_gattc_cb_param_t(*p); // Copy data for events that need it @@ -113,6 +115,8 @@ class BLEEvent { this->event_.gatts.gatts_if = i; // Allocate external storage for param and data + // External allocation is used because GATTC/GATTS events are rare (<1% of events) + // while GAP events (99%) are stored inline to minimize memory usage this->event_.gatts.gatts_param = new esp_ble_gatts_cb_param_t(*p); // Copy data for events that need it