Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work/non template container #47

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

Conversation

tfry-git
Copy link
Owner

@tfry-git tfry-git commented Apr 29, 2023

Create container classes that do not depend on templates.

Notes:
This also opens the possibility to have elements that can be created, and deleted, dynamically. However, we do not have a real strategy for the latter so far. Introducing regular d'tors would cause the compiler to add a lot of tear-down code even in "static" sketches, for no good reason. Adding a virtual "destroy()" function, instead, does not seem to solve the problem (compiler does not appear to be able to figure out, when this code is unused).

An additional problem is that ownership of resources (e.g. array of child elements, but also string constants) is not clearly defined. Some of that work will definitely have to be delegated to the user.

One "relief", however, is that EmbAJAX objects really never make sense in a local scope. They'll either live on the global scope, or on the heap, never on the stack. Thus, implict d'tor calls are not really needed at all.

@tfry-git tfry-git marked this pull request as draft April 29, 2023 13:48
@github-actions
Copy link

Memory usage change @ a701a3f

Board flash % RAM for global variables %
arduino:avr:mega:cpu=atmega2560 💚 -210 - -210 -0.08 - -0.08 💚 -8 - -8 -0.1 - -0.1
esp32:esp32:d32 💚 -664 - -344 -0.05 - -0.03 ❔ -48 - +16 -0.01 - 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A
rp2040:rp2040:rpipicow 💚 -432 - -328 -0.02 - -0.02 ❔ -52 - +12 -0.02 - 0.0
Click for full report table
Board examples/Blink_Ethernet
flash
% examples/Blink_Ethernet
RAM for global variables
% examples/Blink
flash
% examples/Blink
RAM for global variables
% examples/ConnectionStatus
flash
% examples/ConnectionStatus
RAM for global variables
% examples/Inputs
flash
% examples/Inputs
RAM for global variables
% examples/Joystick
flash
% examples/Joystick
RAM for global variables
% examples/Styling
flash
% examples/Styling
RAM for global variables
% examples/TwoPages
flash
% examples/TwoPages
RAM for global variables
% examples/Visibility
flash
% examples/Visibility
RAM for global variables
%
arduino:avr:mega:cpu=atmega2560 -210 -0.08 -8 -0.1
esp32:esp32:d32 -460 -0.04 8 0.0 -476 -0.04 0 0.0 -444 -0.03 -48 -0.01 -456 -0.03 0 0.0 -664 -0.05 8 0.0 -344 -0.03 0 0.0 -640 -0.05 16 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
rp2040:rp2040:rpipicow -352 -0.02 4 0.0 -352 -0.02 4 0.0 -368 -0.02 -4 -0.0 -328 -0.02 -52 -0.02 -360 -0.02 -12 -0.0 -400 -0.02 -4 -0.0 -336 -0.02 4 0.0 -432 -0.02 12 0.0
Click for full report CSV
Board,examples/Blink_Ethernet<br>flash,%,examples/Blink_Ethernet<br>RAM for global variables,%,examples/Blink<br>flash,%,examples/Blink<br>RAM for global variables,%,examples/ConnectionStatus<br>flash,%,examples/ConnectionStatus<br>RAM for global variables,%,examples/Inputs<br>flash,%,examples/Inputs<br>RAM for global variables,%,examples/Joystick<br>flash,%,examples/Joystick<br>RAM for global variables,%,examples/Styling<br>flash,%,examples/Styling<br>RAM for global variables,%,examples/TwoPages<br>flash,%,examples/TwoPages<br>RAM for global variables,%,examples/Visibility<br>flash,%,examples/Visibility<br>RAM for global variables,%
arduino:avr:mega:cpu=atmega2560,-210,-0.08,-8,-0.1
esp32:esp32:d32,,,,,-460,-0.04,8,0.0,-476,-0.04,0,0.0,-444,-0.03,-48,-0.01,-456,-0.03,0,0.0,-664,-0.05,8,0.0,-344,-0.03,0,0.0,-640,-0.05,16,0.0
esp8266:esp8266:huzzah,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
rp2040:rp2040:rpipicow,-352,-0.02,4,0.0,-352,-0.02,4,0.0,-368,-0.02,-4,-0.0,-328,-0.02,-52,-0.02,-360,-0.02,-12,-0.0,-400,-0.02,-4,-0.0,-336,-0.02,4,0.0,-432,-0.02,12,0.0

@github-actions
Copy link

github-actions bot commented May 4, 2023

Memory usage change @ 592e376

Board flash % RAM for global variables %
arduino:avr:mega:cpu=atmega2560 💚 -336 - -336 -0.13 - -0.13 💚 -108 - -108 -1.32 - -1.32
esp32:esp32:d32 💚 -784 - -388 -0.06 - -0.03 ❔ -512 - +8 -0.16 - 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A
rp2040:rp2040:rpipicow 💚 -624 - -360 -0.03 - -0.02 ❔ -516 - +4 -0.2 - 0.0
Click for full report table
Board examples/Blink_Ethernet
flash
% examples/Blink_Ethernet
RAM for global variables
% examples/Blink
flash
% examples/Blink
RAM for global variables
% examples/ConnectionStatus
flash
% examples/ConnectionStatus
RAM for global variables
% examples/Inputs
flash
% examples/Inputs
RAM for global variables
% examples/Joystick
flash
% examples/Joystick
RAM for global variables
% examples/Styling
flash
% examples/Styling
RAM for global variables
% examples/TwoPages
flash
% examples/TwoPages
RAM for global variables
% examples/Visibility
flash
% examples/Visibility
RAM for global variables
%
arduino:avr:mega:cpu=atmega2560 -336 -0.13 -108 -1.32
esp32:esp32:d32 -560 -0.04 -128 -0.04 -508 -0.04 0 0.0 -600 -0.05 -184 -0.06 -484 -0.04 0 0.0 -728 -0.06 8 0.0 -388 -0.03 0 0.0 -784 -0.06 -512 -0.16
esp8266:esp8266:huzzah N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
rp2040:rp2040:rpipicow -416 -0.02 -132 -0.05 -424 -0.02 -124 -0.05 -368 -0.02 -4 -0.0 -624 -0.03 -188 -0.07 -360 -0.02 -12 -0.0 -472 -0.02 -4 -0.0 -368 -0.02 4 0.0 -568 -0.03 -516 -0.2
Click for full report CSV
Board,examples/Blink_Ethernet<br>flash,%,examples/Blink_Ethernet<br>RAM for global variables,%,examples/Blink<br>flash,%,examples/Blink<br>RAM for global variables,%,examples/ConnectionStatus<br>flash,%,examples/ConnectionStatus<br>RAM for global variables,%,examples/Inputs<br>flash,%,examples/Inputs<br>RAM for global variables,%,examples/Joystick<br>flash,%,examples/Joystick<br>RAM for global variables,%,examples/Styling<br>flash,%,examples/Styling<br>RAM for global variables,%,examples/TwoPages<br>flash,%,examples/TwoPages<br>RAM for global variables,%,examples/Visibility<br>flash,%,examples/Visibility<br>RAM for global variables,%
arduino:avr:mega:cpu=atmega2560,-336,-0.13,-108,-1.32
esp32:esp32:d32,,,,,-560,-0.04,-128,-0.04,-508,-0.04,0,0.0,-600,-0.05,-184,-0.06,-484,-0.04,0,0.0,-728,-0.06,8,0.0,-388,-0.03,0,0.0,-784,-0.06,-512,-0.16
esp8266:esp8266:huzzah,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
rp2040:rp2040:rpipicow,-416,-0.02,-132,-0.05,-424,-0.02,-124,-0.05,-368,-0.02,-4,-0.0,-624,-0.03,-188,-0.07,-360,-0.02,-12,-0.0,-472,-0.02,-4,-0.0,-368,-0.02,4,0.0,-568,-0.03,-516,-0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant