-
-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: enhancementProposed improvementProposed improvementtype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Embedded devices should avoid to use memory allocation - or limit allocations to minimum. Unfortunately, the code for WiFi does not honour this rule.
- don't use std::string, use static allocated buffer
- don't use std::make_shared - we have C++17, implementing copy constructors for every class is no longer required. WiFiClient can have preallocated buffer as member variable. The programmer can possibly choose to use std::make_shared for the whole WiFIClient instance, if it needs to share it by other objects.
- typo: destroy_at_distructor
- bug: the flag destroy_at_distructor is never used, destructor is empty.
WiFiClient::WiFiClient() : _sock(-1), destroy_at_distructor(true), rx_buffer(nullptr) { |
Metadata
Metadata
Assignees
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: enhancementProposed improvementProposed improvementtype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project