|
From: Luke D. <cod...@ho...> - 2003-10-07 12:16:15
|
----- Original Message ----- From: "Danny Smith" <dan...@cl...> To: "mingw-dvlpr" <min...@li...> Sent: Tuesday, October 07, 2003 6:08 PM Subject: [MinGW-dvlpr] _alloca/_chkstk?? > Does any one really know why GCC (and other windows compilers) insert > code for checking stack when allocating more than a page? > > I can see where it would be useful with SEH exceptions (the OS throws an > 0x80010001 exception if stack cannot be grown) but how else is needed? > > Danny http://msdn.microsoft.com/library/en-us/vccore98/HTML/_core_.2f.gs.asp I guess it is for efficiency to make page faults more predictable but it's hard to imagine that it would have a significant effect. A number of smaller stack frames could also cause a fault so I can't see that it would actually be *needed* for correctness. Is there a particular reason to remove it though, apart from when statically linking GCC-compiled objects with MSVC programs or vice versa? (I'm thinking of the undefined references to __alloca). It could be useful to have a GCC equivalent of "/Gs" to optionally disable this feature, if there isn't one already. Luke |