Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Project build order/dependencies, Should they work ? Pin
Maximilien15-Nov-23 7:47
Maximilien15-Nov-23 7:47 
GeneralRe: Project build order/dependencies, Should they work ? Pin
Greg Utas15-Nov-23 8:02
professionalGreg Utas15-Nov-23 8:02 
GeneralRe: Project build order/dependencies, Should they work ? Pin
Maximilien15-Nov-23 9:21
Maximilien15-Nov-23 9:21 
GeneralRe: Project build order/dependencies, Should they work ? Pin
Greg Utas15-Nov-23 9:48
professionalGreg Utas15-Nov-23 9:48 
AnswerRe: (Visual Studio) Project build order/dependencies, Should they work ? Pin
honey the codewitch15-Nov-23 9:55
mvahoney the codewitch15-Nov-23 9:55 
GeneralRe: (Visual Studio) Project build order/dependencies, Should they work ? Pin
jschell16-Nov-23 4:50
jschell16-Nov-23 4:50 
QuestionEmbedded and dynamic memory allocation Pin
honey the codewitch15-Nov-23 4:32
mvahoney the codewitch15-Nov-23 4:32 
AnswerRe: Embedded and dynamic memory allocation Pin
Mircea Neacsu15-Nov-23 4:53
Mircea Neacsu15-Nov-23 4:53 
honey the codewitch wrote:
How terrible is this approach? I'm self taught and was sort of drafted into embedded so I'm unsure of myself here.
Not so terrible, rest assured; don't damage your self-esteem Big Grin | :-D

The biggest issue with dynamic allocation, and where this mantra of "no mallocs" came, is the potential for memory fragmentation. You don't know how well the memory manager behaves and you risk running out of big memory chunks.

However, if you think about it, this is a phenomena specific to multi-tasking, where each task is oblivious of other tasks that may exist in the system. This is not what happens in an embedded system where you have only one "task" (footnote: yes, there are exceptions to this scenario). You certainly have multiple threads but those threads cooperate, not compete for resources.

If you would have an anal boss that wants to enforce the "no malloc" rule, you can allocate all the available memory and run a memory manager inside your app that allocates chunks of this pool. On the outside the system would behave the same way because there is only one task/app. Again, I'm over-simplifying here: there is still a network stack that needs some buffers but you get the gist. In embedded world, quoting Taylor Swift: "This is our place, we make the call".
Mircea

GeneralRe: Embedded and dynamic memory allocation Pin
honey the codewitch15-Nov-23 4:57
mvahoney the codewitch15-Nov-23 4:57 
GeneralRe: Embedded and dynamic memory allocation Pin
Mircea Neacsu15-Nov-23 5:04
Mircea Neacsu15-Nov-23 5:04 
GeneralRe: Embedded and dynamic memory allocation Pin
honey the codewitch15-Nov-23 5:17
mvahoney the codewitch15-Nov-23 5:17 
GeneralRe: Embedded and dynamic memory allocation Pin
Greg Utas15-Nov-23 6:36
professionalGreg Utas15-Nov-23 6:36 
GeneralRe: Embedded and dynamic memory allocation Pin
honey the codewitch15-Nov-23 9:06
mvahoney the codewitch15-Nov-23 9:06 
GeneralRe: Embedded and dynamic memory allocation Pin
trønderen16-Nov-23 1:34
trønderen16-Nov-23 1:34 
GeneralRe: Embedded and dynamic memory allocation Pin
Greg Utas16-Nov-23 2:54
professionalGreg Utas16-Nov-23 2:54 
GeneralRe: Embedded and dynamic memory allocation Pin
trønderen16-Nov-23 5:04
trønderen16-Nov-23 5:04 
GeneralRe: Embedded and dynamic memory allocation Pin
Greg Utas16-Nov-23 8:44
professionalGreg Utas16-Nov-23 8:44 
GeneralRe: Embedded and dynamic memory allocation Pin
trønderen16-Nov-23 10:23
trønderen16-Nov-23 10:23 
GeneralRe: Embedded and dynamic memory allocation Pin
Greg Utas16-Nov-23 12:50
professionalGreg Utas16-Nov-23 12:50 
AnswerRe: Embedded and dynamic memory allocation Pin
CPallini15-Nov-23 20:12
mveCPallini15-Nov-23 20:12 
GeneralRe: Embedded and dynamic memory allocation Pin
honey the codewitch16-Nov-23 0:41
mvahoney the codewitch16-Nov-23 0:41 
GeneralRe: Embedded and dynamic memory allocation Pin
CPallini16-Nov-23 0:55
mveCPallini16-Nov-23 0:55 
AnswerRe: Embedded and dynamic memory allocation Pin
leon de boer8-Dec-23 20:59
leon de boer8-Dec-23 20:59 
QuestionC++ reflection Pin
jschell15-Nov-23 3:26
jschell15-Nov-23 3:26 
AnswerRe: C++ reflection Pin
Mircea Neacsu15-Nov-23 3:41
Mircea Neacsu15-Nov-23 3:41 

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.