Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
runtime, cmd/compile: implicit allocations allowed in the runtime #42158
We have a test in the compiler that ensures that we don't have any implicit allocations in the runtime. We want all allocations that the runtime does to be explicit (to avoid things like self-deadlock when allocating inside malloc).
I hacked a simple test into the compiler, and found a bunch of situations where this implicit allocation happens. An example:
This code needs to allocate a
I ran into this issue in a CL I'm working on where implicit allocations were happening in a bad place, and it took me a while to track it down. It would have been much easier for the compiler to give me an error.