forked from fyne-io/fyne
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove constant debug field from canvas
Thisclears out a small amount of memory usageby moving a build-constant field to a global constant variable. Most importantly, it makes Go have a better time deadcode eliminating methods that we only want to compile in for debug (especially the reflect code that gets the name of the canvasobject).
- Loading branch information
Showing
6 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//go:build !debug | ||
// +build !debug | ||
|
||
package internal | ||
|
||
// BuildTypeIsDebug is true if built with -tags debug. This value exists as a constant | ||
// so the Go compiler can deadcode eliminate reflect from non-debug builds. | ||
const BuildTypeIsDebug = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//go:build debug | ||
// +build debug | ||
|
||
package internal | ||
|
||
// BuildTypeIsDebug is true if built with -tags debug. This value exists as a constant | ||
// so the Go compiler can deadcode eliminate reflect from non-debug builds. | ||
const BuildTypeIsDebug = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters