« first day (1288 days earlier)      last day (1548 days later) » 

1:52 AM
> Other memory allocation functions, such as malloc and LocalAlloc, cannot use a reserved range of memory until it is released.
So there is no link between new/delete and VirtualAlloc.
I'm starting to suspect that the nVidia driver will "cache" our big textures, because it knows that the RAM is infinite and the VRAM has only 8 GB, and so it prepares to do texture swap...
 
 
11 hours later…
12:43 PM
Is there a way to get more information than message: std::bad_alloc? I think it's caused from std::vector using too much memory. In the program there's a way to calculate what the maximum size of the vector should be and that's set in its initialization. Is there a way I can know vector size (or attempt at reallocation) at the time of crash?
 
@Vaillancourt no they use HeapAlloc which may or may not call VirtualAlloc
 
@northerner if you are running in a debugger you can have it break on the exception and then check the capacity
 
1:02 PM
@northerner depends on which OS. MSVC has the debug heap
 
 
1 hour later…
2:23 PM
@northerner You can also try to reserve the memory yourself and wrap this in a try/catch.
@Mgetz Oh, I thought they used malloc/free internally!
 
@Vaillancourt they have in the past and in 2010 they might have. But underlying malloc and free is HeapAlloc and HeapFree which is why MS can't implement aligned_alloc
@Vaillancourt Extremely likely if they are still bound to resources. Technically it shouldn't do this in DX12/Vulkan.
 
user6461957
In socket programming a accept() blocks, so if I have two threads for both server and client, I have to make the server wait for the client to connect, correct?
 
2:39 PM
int main(void)
{
unsigned char i = 120;
  for(;i=i>>2; )
    printf("%d\t", i);
}
i understand that it should print 30 7 1 after right shifts ....But why is it not printing the 0s?
Like I believe this should be an infinite loop giving: 30 7 1 0 0 0 0 ....
 
@Mgetz (We're using OpenGL, but for some reasons, the nvidia drivers use some parts of the dx infrastructure.)
 
@Vaillancourt if you want to interact with hardware you'd pretty much have to
 
@Archer the middle clause of the for is the condition, if it evaluates to false (or 0) it stops the loop
and assignment operator evaluates to the value assigned
 
@Mgetz So Our OpenGL calls go through nvidia's drivers, then are "converted" into Direct3D calls because that's what MS offers?
 
@ratchetfreak oops, yes! Thanks.
 
2:48 PM
no there is a layer under D3D which also goes through nvidia
 
@Vaillancourt not exactly. The way NT's IO system works normally you're at DISPATCH priority IIRC. But there are APIs that say "HEY Scheduler! This is DX/graphics, It needs as high as as reasonably safe priority"
but to do that you need to tell the IO system what memory window you need etc beforehand so it can hold onto it and not release it (as it normally would)
 
nwp
@Archer The middle part of the for-loop is used for a test if the for-loop should continue. That middle condition is i=i>>2 which evaluates to the value of i after shifting. For int the value 0 is considered false and everything else true, so once it hits 0 it breaks out of the loop.
 
yeah normally IO on NT is very very async. You open a window, you put the data there, and you tell the device the data is there. You then have the device tell the OS when it's done and you close the window
 
user6461957
On the server side, I am doing a mutex_lock; while(1) cond_wait; accept(); mutex_unlock; and on the client side mutex_lock; connect(); cond_signal(); mutex_unlock;
 
Window in this context btw is a direct mapping to some system ram for DMA
 
user6461957
2:57 PM
Now it goes inside the client thread and executes everything up to the connect and then it is in a block state indefinitely..
 
3 messages moved from Lounge<C++>
 
user6461957
Okay
 
user6461957
Source code: privatebin.net/…
 
@ratchetfreak @Mgetz Well this is all pretty complicated :P Haven't looked/worked that close to the system
 
What does this while mean: int i = 0; while(i<4,5) {..}
4,5 ... How does it work?
 
nwp
3:07 PM
There is a , operator. Basically it evaluates all the pieces from left to right and returns the value on the right. If you look at the operator precedence you will see that , is weaker than <, so it's (i<4),5 so it does the test, i<4 which evaluates to true or false, then it evaluates 5 which is true so this is an infinite loop.
Unless I screwed up. Normally you don't write such horrible code. I hope it's just for a dumb quiz.
 
@ratchetfreak IIRC it's three layers OGL->GfxDriverInternal (userspace) -> Graphics Driver Internal (Kernel space). With OS in between all of those IIRC. The openGL/DX primary translation is done in User space IIRC.
 
@nwp true dat. It's for a dumb quiz XD
 
@Mgetz That would be super convenient if we used malloc, and I'm not sure it can find stuff that is set up by the nVidia driver?
 
@Vaillancourt you can't except through a debugger or windbg
Are you releasing the OGL resources ASAP?
 
3:22 PM
I guess I'll have to use windbg at some point.
@Mgetz What do you mean "releasing ASAP"? We only interface with the rendering egine that we use.
 
@Vaillancourt then I'd check the documentation for your engine
 
The pattern is "load the model > compile the texture to the VRAM". This appears to work fine in 32bit, but in 64bit, it seems to hog a ton of "Private data" (reported by VMMAP).
 
@Vaillancourt it probably was in 32bit too.. you just didn't see it because it was in 64bit segments
 
@Mgetz Unfortunately, there is not really such a thing ("check the examples, check in the code"), but yeah, the next step is to reproduce the issue in an MCVE, and submit that to the support group...
 
@Vaillancourt it does look like OSG does cache FWIW
so it's probably your code
 
3:29 PM
@Mgetz It does some caching, yes; it also looks if it's safe to release the textures after they've been compiled, and it appears to be doing it (the pointer to the image is set to null).
It could be our code, or OSG's code.
Same app, run in the say way, only difference is the first one is in 32bit, the second is in 64bit.
 
@Vaillancourt honestly it might just be the system holding on to it because you've needed it and it expects you to need it again for a bit. But I'd check to see if you have leaks
 
@Mgetz This is what I'm suspecting. It would be done by the nVidia layer, though, I don't think this OSG does this.
 
ETW is probably the right place to start FWIW
 
@Mgetz Looks, helpful, thanks, I'll take a look at those!
 
This - ` abc x = abc(matImage, count); `
function returns struct abc {
std::vector<cv::Vec3b> colors;
cv::Mat quantized;
cv::Mat viewable;
cv::Mat dom;
};
I want to now return this from main() too as I am calling it in a python script, but I guess I cannot return multiple things from main(). How do I do that?
 
3:43 PM
@AshwinPhadke you can't return non-int from main... you need to supply that back to python most likely on stdio or via a python plugin... which doesn't have a main
 
@Mgetz Okay, So as a alternative I execute the compiled CPP program in python and just pass arguments as I cannot return non int but now when I execute it regulary as ./abc d e it executes correctly but as I execute it in python nothing happens but returns the object. Is there any issue with the process execution.
 
@AshwinPhadke so that's stupid dangerous in practice look up the openCGI vuln
 
Oh didn't knew that. Boost seems like to much work so was doing this.
 
remember any time you're using a shell to execute things you need to be super careful
 
Noted.
 
 
2 hours later…
5:47 PM
std::cout << "This is my first time visiting the chat ";
std::cin >> howDoesThisWork;
 
@ArdentCoder Ask question about c++, someone will answer, eventually :)
(And don't ask to ask, just ask.)
 
Haha I was just testing this
@Valliancourt were you notified about my message?
 
Notified how? My tab gets a different colour when there is activity here, otherwise I don't get notified, no.
 
Oh, I see
How experienced are you with C++? Can I ask questions like these here or will I get flagged for it?
 
@ArdentCoder I don't think you'll get flagged, but they're not super relevant ;)
I've been working with it for at least the past 10 years?
 
5:53 PM
Cool
I'm just a student from a rural area
 
@ArdentCoder You can drop the "just" :)
 
Haha I added that to show my inferiority to a 10-year experienced developer :P
 
I ask more questions here that I can answer them.
 
Lol
How is the industry like? What projects do you generally work on using C++?
 
6:23 PM
1) I don't know 2) I work on a 3d app; I worked on video games before.
 
Hmm
Apart from maths, how much C++ does one have to know in order to work on such projects?
 
Basics in OpenGL or Direct3d if you want to touch graphics.
Aside from that it's much more about the desire to learn that the basic c++.
 
6:39 PM
Oops that's too hard and nobody teaches it in my state
I do self-learning and for graphics I have preferred QT
 
You're often stuck with self-learning, so better learn that as early as possible ;P
 
Yikes
Nice time here, bbl
 
7:13 PM
Has the /LARGEADDRESSAWARE linker flag any effect when building in 64bit?
 
 
3 hours later…
10:19 PM
I'd like to automatically add #include <ciso646> on top of every file when the compiler is MSVC, which allows me to write and, xor etc., it's possible to do this in CMake?
 
 
1 hour later…
11:39 PM
@LanYi you could piggyback on precompiled headers?
 

« first day (1288 days earlier)      last day (1548 days later) »