Disable GPU for Ubuntu18.04#647
Disable GPU for Ubuntu18.04#647g-217 wants to merge 1 commit intoadobe:masterfrom g-217:brackets4ubuntu18.04
Conversation
|
|
||
| // Program entry point function. | ||
| int main(int argc, char* argv[]) { | ||
| char extra_option[14]; |
There was a problem hiding this comment.
The indendation is off.
| // Program entry point function. | ||
| int main(int argc, char* argv[]) { | ||
| char extra_option[14]; | ||
| snprintf(extra_option,sizeof(extra_option),"--disable-gpu"); |
There was a problem hiding this comment.
Instead of doing all this, why don't you use std:string, it's cleaner, and bounds safe.
Something like:
std::string gpuArg = "--disable-gpu";
argv[argc] = gpuArgs.c_str();
argc++;
There was a problem hiding this comment.
I don't want to go to heap. For std::string Small string optimization may kick in here(heap allocation will not be done in that case), but snprintf will ensure that there is no buffer overrun here anyway.
There was a problem hiding this comment.
I don't get your point. The optimization(vendor dependent) here won't matter since this is a very small operation at start up, and if it does happen, it will only be for good. Moreover what I wrote came from the general conventions followed in brackets-shell repo. See usage of CefString and std::string.
Also the indentation and spacing in the code is still off.
No description provided.