Click here to Skip to main content
15,887,027 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: Wordle 733 (3/6) Pin
Jeremy Falcon22-Jun-23 4:37
professionalJeremy Falcon22-Jun-23 4:37 
GeneralRe: Wordle 733 x/6 Pin
jmaida22-Jun-23 15:12
jmaida22-Jun-23 15:12 
GeneralThere was an Embbed Q& A was there? Pin
glennPattonWork321-Jun-23 3:45
professionalglennPattonWork321-Jun-23 3:45 
GeneralRe: There was an Embbed Q& A was there? Pin
Pete O'Hanlon21-Jun-23 3:50
mvePete O'Hanlon21-Jun-23 3:50 
GeneralRe: There was an Embbed Q& A was there? Pin
glennPattonWork321-Jun-23 3:56
professionalglennPattonWork321-Jun-23 3:56 
GeneralRe: There was an Embbed Q& A was there? Pin
pkfox21-Jun-23 22:11
professionalpkfox21-Jun-23 22:11 
GeneralRe: There was an Embbed Q& A was there? Pin
Pete O'Hanlon22-Jun-23 2:03
mvePete O'Hanlon22-Jun-23 2:03 
GeneralNuclear Alpha Blending: A C++ war story Pin
honey the codewitch21-Jun-23 2:59
mvahoney the codewitch21-Jun-23 2:59 
To be clear, this is not a programming question. I don't need help with this, it's just something I don't want to do, which I'm sure other C++ developers can relate to.

I am not using the STL because this has to run on machines with very little RAM, and with questionably compliant headers.

I have a paint routine in my canvas controls that I'm drawing a gradient in. This routine uses alpha-blending between two RGBa8888 or HSVa8888 colors to accommodate creating the gradient. It's relatively simple in practice because my library handles the alpha blending. You just call a blend function and pass it a scaled ratio between 0 and 1. The alpha blending is completely battle tested and used all over the library to do things like anti-alias fonts.

The paint routine more or less works as long as I don't call the blend function to create the gradient. As soon as I add the call, I get corrupted data in my incoming serial stream (handled in a separate C++ implementation file) and the app hangs, pretty reliably. It's about the only reliable thing about it.

C and C++ developers already know where this is headed. Cry | :((

Heap corruption has reared its ugly head. This is probably related to the fact that I am not using the STL to do anything. A lot of times I wish I was but IoT leaves me little of the STL to practically use.

My options are:

- Rewrite, and maybe prototype using the STL, which at least works on the ESP32 platform. The codebase is pretty small and some of it is reusable.

- Instrument my code for heap testing. This is a pain in my backside, particularly if the heap corruption is coming from my graphics library or my data structures library. I doubt it, but you never know.

- rearchitect my code so it doesn't need dynamic allocations. This would make it far less efficient and probably overflow the .bss segment on less capable devices with all the statically initialized arrays.

Kevin bless IoT development.
Check out my IoT graphics library here:
https://honeythecodewitch/gfx

GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
CPallini21-Jun-23 3:05
mveCPallini21-Jun-23 3:05 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
Storm-blade21-Jun-23 3:49
professionalStorm-blade21-Jun-23 3:49 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
honey the codewitch21-Jun-23 6:46
mvahoney the codewitch21-Jun-23 6:46 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
Nelek21-Jun-23 11:46
protectorNelek21-Jun-23 11:46 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
Single Step Debugger21-Jun-23 5:44
Single Step Debugger21-Jun-23 5:44 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
jmaida21-Jun-23 11:18
jmaida21-Jun-23 11:18 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
honey the codewitch21-Jun-23 11:23
mvahoney the codewitch21-Jun-23 11:23 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
jmaida21-Jun-23 12:16
jmaida21-Jun-23 12:16 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
jmaida21-Jun-23 13:19
jmaida21-Jun-23 13:19 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
Greg Utas21-Jun-23 14:14
professionalGreg Utas21-Jun-23 14:14 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
honey the codewitch21-Jun-23 14:38
mvahoney the codewitch21-Jun-23 14:38 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
Greg Utas21-Jun-23 15:12
professionalGreg Utas21-Jun-23 15:12 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
honey the codewitch21-Jun-23 17:53
mvahoney the codewitch21-Jun-23 17:53 
GeneralRe: Nuclear Alpha Blending: A C++ war story Pin
jschell22-Jun-23 8:24
jschell22-Jun-23 8:24 
GeneralThis looks like an odd one... Pin
Graeme_Grant21-Jun-23 1:03
mvaGraeme_Grant21-Jun-23 1:03 
GeneralRe: This looks like an odd one... Pin
Richard MacCutchan21-Jun-23 1:11
mveRichard MacCutchan21-Jun-23 1:11 
GeneralRe: This looks like an odd one... Pin
Graeme_Grant21-Jun-23 3:35
mvaGraeme_Grant21-Jun-23 3:35 

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.