Click here to Skip to main content
15,914,767 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'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
honey the codewitch27-Jun-20 7:23
mvahoney the codewitch27-Jun-20 7:23 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
Sander Rossel28-Jun-20 0:48
professionalSander Rossel28-Jun-20 0:48 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
honey the codewitch28-Jun-20 1:34
mvahoney the codewitch28-Jun-20 1:34 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
Greg Utas28-Jun-20 1:55
professionalGreg Utas28-Jun-20 1:55 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
Sander Rossel28-Jun-20 2:31
professionalSander Rossel28-Jun-20 2:31 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
Greg Utas28-Jun-20 2:44
professionalGreg Utas28-Jun-20 2:44 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
Stuart Dootson29-Jun-20 4:08
professionalStuart Dootson29-Jun-20 4:08 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
honey the codewitch29-Jun-20 4:21
mvahoney the codewitch29-Jun-20 4:21 
I've run into the same problem as you before. The solution is to marshal the objects as IntPtrs, and manually release them when you're done, if I recall correctly. That way you control the lifetime explicitly. It makes things easier.

I solved the problem with my MIDI code in the OP, and then improved on it several times Big Grin | :-D to make it more efficient and easier to read the code. Now in my entire streaming codebase i only have one win32 global heap allocation that happens once you open a device, until you close it. I've taken to marshalling all structs as ref (struct) except for a very complicated vector of variable length structs which I have to mangle manually.

So it's golden now, and even mostly easier to read and maintain when I'm done. Cool beans.
Real programmers use butterflies

GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
Stuart Dootson29-Jun-20 6:05
professionalStuart Dootson29-Jun-20 6:05 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
honey the codewitch29-Jun-20 6:17
mvahoney the codewitch29-Jun-20 6:17 
GeneralRe: I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question) Pin
Stuart Dootson29-Jun-20 6:29
professionalStuart Dootson29-Jun-20 6:29 
Generalnot sure where to put this. introductions (again) Pin
honey the codewitch27-Jun-20 1:29
mvahoney the codewitch27-Jun-20 1:29 
GeneralRe: not sure where to put this. introductions (again) Pin
Garth J Lancaster27-Jun-20 1:36
professionalGarth J Lancaster27-Jun-20 1:36 
GeneralRe: not sure where to put this. introductions (again) Pin
honey the codewitch27-Jun-20 1:55
mvahoney the codewitch27-Jun-20 1:55 
GeneralRe: not sure where to put this. introductions (again) Pin
Greg Utas27-Jun-20 1:41
professionalGreg Utas27-Jun-20 1:41 
GeneralRe: not sure where to put this. introductions (again) Pin
honey the codewitch27-Jun-20 1:56
mvahoney the codewitch27-Jun-20 1:56 
GeneralRe: not sure where to put this. introductions (again) Pin
Nelek27-Jun-20 3:07
protectorNelek27-Jun-20 3:07 
GeneralRe: not sure where to put this. introductions (again) Pin
honey the codewitch27-Jun-20 6:17
mvahoney the codewitch27-Jun-20 6:17 
GeneralRe: not sure where to put this. introductions (again) Pin
Nelek28-Jun-20 11:05
protectorNelek28-Jun-20 11:05 
GeneralRe: not sure where to put this. introductions (again) Pin
Sander Rossel28-Jun-20 0:25
professionalSander Rossel28-Jun-20 0:25 
GeneralRe: not sure where to put this. introductions (again) Pin
Ron Anders27-Jun-20 3:25
Ron Anders27-Jun-20 3:25 
PraiseRe: not sure where to put this. introductions (again) Pin
abmv27-Jun-20 4:46
professionalabmv27-Jun-20 4:46 
GeneralRe: not sure where to put this. introductions (again) Pin
den2k8827-Jun-20 8:01
professionalden2k8827-Jun-20 8:01 
GeneralRe: not sure where to put this. introductions (again) Pin
ZurdoDev27-Jun-20 8:46
professionalZurdoDev27-Jun-20 8:46 
GeneralRe: not sure where to put this. introductions (again) Pin
RickZeeland27-Jun-20 19:44
mveRickZeeland27-Jun-20 19:44 

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.