Click here to Skip to main content
15,887,214 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I was sent this, and... Pin
Chris C-B11-Sep-22 19:41
Chris C-B11-Sep-22 19:41 
GeneralRe: I was sent this, and... Pin
Gerry Schmitz11-Sep-22 10:34
mveGerry Schmitz11-Sep-22 10:34 
GeneralRe: I was sent this, and... Pin
Slow Eddie12-Sep-22 2:05
professionalSlow Eddie12-Sep-22 2:05 
JokeFed Up PinPopular
Mike Hankey11-Sep-22 2:59
mveMike Hankey11-Sep-22 2:59 
GeneralRe: Fed Up Pin
jmaida11-Sep-22 15:09
jmaida11-Sep-22 15:09 
GeneralRe: Fed Up Pin
Super Lloyd11-Sep-22 20:00
Super Lloyd11-Sep-22 20:00 
GeneralRe: Fed Up Pin
BernardIE531711-Sep-22 23:00
BernardIE531711-Sep-22 23:00 
GeneralI'm having fun contrasting my style with LVGLs Pin
honey the codewitch10-Sep-22 15:39
mvahoney the codewitch10-Sep-22 15:39 
LVGL is fast, and amazing, so I'm not criticizing it, but they make choices I wouldn't have.

One thing is, they do a lot of little heap allocations without a custom allocator scheme.

for example (C code)
C++
lv_label_t *my_label = lv_label_create(yada,yada);
...
lv_label_destroy(my_label);


Whereas in htcw_gfx, or most of my IoT code for that matter it's
C++
lv_label_t my_label;
lv_label_create(&my_label,yada,yada);
...
// might not be necessary at all:
lv_label_destroy(my_label);


The difference is subtle but not insignificant. The key here is the caller is responsible for allocations.

This allows you to declare a globals for example:

C++
lv_label_t global_label1;
lv_label_t global_label2;


And then use those without whipping the heap at all.

That and in other cases they just use the heap like it's free, and I'm over here, like "how do you even run on systems with 48KB of RAM?"

It floors me. This whole time I've treated heap allocations on IoT like blood diamonds: Expensive, horrible, to be avoided at almost any cost, and really we don't want to talk about what goes into them.

I don't use malloc in my IoT code unless there's no other choice.

Anyway, it was just an interesting contrast, and I learned that maybe I'm being too paranoid about managing my SRAM.
To err is human. Fortune favors the monsters.

GeneralRe: I'm having fun contrasting my style with LVGLs Pin
jmaida10-Sep-22 16:29
jmaida10-Sep-22 16:29 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
honey the codewitch10-Sep-22 16:40
mvahoney the codewitch10-Sep-22 16:40 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
jmaida10-Sep-22 16:50
jmaida10-Sep-22 16:50 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
den2k8811-Sep-22 21:31
professionalden2k8811-Sep-22 21:31 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
honey the codewitch12-Sep-22 4:21
mvahoney the codewitch12-Sep-22 4:21 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
den2k8811-Sep-22 21:29
professionalden2k8811-Sep-22 21:29 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
Randor 10-Sep-22 17:52
professional Randor 10-Sep-22 17:52 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
honey the codewitch10-Sep-22 18:40
mvahoney the codewitch10-Sep-22 18:40 
JokeRe: I'm having fun contrasting my style with LVGLs Pin
Randor 10-Sep-22 19:25
professional Randor 10-Sep-22 19:25 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
honey the codewitch10-Sep-22 20:24
mvahoney the codewitch10-Sep-22 20:24 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
jmaida11-Sep-22 16:56
jmaida11-Sep-22 16:56 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
honey the codewitch11-Sep-22 17:01
mvahoney the codewitch11-Sep-22 17:01 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
jmaida11-Sep-22 17:48
jmaida11-Sep-22 17:48 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
honey the codewitch11-Sep-22 19:29
mvahoney the codewitch11-Sep-22 19:29 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
jmaida11-Sep-22 17:37
jmaida11-Sep-22 17:37 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
honey the codewitch11-Sep-22 19:30
mvahoney the codewitch11-Sep-22 19:30 
GeneralRe: I'm having fun contrasting my style with LVGLs Pin
jmaida12-Sep-22 7:27
jmaida12-Sep-22 7:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.