Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Disable GPU for Ubuntu18.04#647

Closed
g-217 wants to merge 1 commit intoadobe:masterfrom
g-217:brackets4ubuntu18.04
Closed

Disable GPU for Ubuntu18.04#647
g-217 wants to merge 1 commit intoadobe:masterfrom
g-217:brackets4ubuntu18.04

Conversation

@g-217
Copy link
Copy Markdown
Contributor

@g-217 g-217 commented May 11, 2018

No description provided.

Comment thread appshell/cefclient_gtk.cc

// Program entry point function.
int main(int argc, char* argv[]) {
char extra_option[14];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indendation is off.

Comment thread appshell/cefclient_gtk.cc
// Program entry point function.
int main(int argc, char* argv[]) {
char extra_option[14];
snprintf(extra_option,sizeof(extra_option),"--disable-gpu");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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++;

Copy link
Copy Markdown
Contributor Author

@g-217 g-217 May 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants