internal/gocore: have single entry point for makeMemRoot (refactor)

I was reading through the code and found that getting all references
(places where roots are made) was made a little more difficult by having
a separate `p.makeMemRoot` versus `makeMemRoot`.

I can understand why it was done: to make `gocore.Core(...)` function
rely more on `core.Process` and make it clearer what the dependencies
are. But the `nRoots` passing is awkward.

Change-Id: I3d8f6f8d9c46a09740a4d28fbe742e0af27b806a
Reviewed-on: https://go-review.googlesource.com/c/debug/+/748440
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Nicolas Hillegeer <aktau@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
3 files changed
tree: 7f028c3e15dc8107184a274446c160f037876407
  1. cmd/
  2. dwtest/
  3. internal/
  4. third_party/
  5. codereview.cfg
  6. CONTRIBUTING.md
  7. go.mod
  8. go.sum
  9. LICENSE
  10. README.md
README.md

Go Debug

Go Reference

This repository holds utilities and libraries for debugging Go programs.

WARNING! Please expect breaking changes and unstable APIs. Most of them are currently at an early, experimental stage.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/debug.

The main issue tracker for the debug repository is located at https://go.dev/issues. Prefix your issue with “x/debug:” in the subject line, so it is easy to find.