Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

(WifiS3 WiFiClient) Reduce memory allocations #407

Copy link
Copy link
Open
@ondra-novak

Description

@ondra-novak
Issue body actions

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

No one assigned

    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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.