Skip to content

Commit

Permalink
adapter loader for enable string container
Browse files Browse the repository at this point in the history
  • Loading branch information
pkujhd committed Nov 11, 2021
1 parent c1c0ff8 commit f3d61eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func main() {
var parseFile = flag.String("parse", "", "parse go object file")
var run = flag.String("run", "main.main", "run function")
var times = flag.Int("times", 1, "run count")
var enableStringContainer = flag.Int("s", 1, "enable string container")

flag.Parse()

Expand Down Expand Up @@ -68,6 +69,10 @@ func main() {
goloader.RegTypes(symPtr, runtime.LockOSThread, &w, w.Wait)
goloader.RegTypes(symPtr, fmt.Sprint)

if *enableStringContainer == 1 {
goloader.OpenStringMap()
}

linker, err := goloader.ReadObjs(files.File, files.PkgPath)
if err != nil {
fmt.Println(err)
Expand Down

0 comments on commit f3d61eb

Please sign in to comment.