Descriptionruntime: avoid allocation of internal panic values
If a fault happens in malloc, inevitably the next thing that happens
is a deadlock trying to allocate the panic value that says the fault
happened. Stop doing that, two ways.
First, reject panic in malloc just as we reject panic in garbage collection.
Second, runtime.panicstring was using an error implementation
backed by a Go string, so the interface held an allocated *string.
Since the actual errors are C strings, define a new error
implementation backed by a C char*, which needs no indirection
and therefore no allocation.
This second fix will avoid allocation for errors like nil panic derefs
or division by zero, so it is worth doing even though the first fix
should take care of faults during malloc.
Update issue 6419
Patch Set 1 #Patch Set 2 : diff -r 5981425e55ce https://code.google.com/p/go/ #Patch Set 3 : diff -r 5981425e55ce https://code.google.com/p/go/ #Patch Set 4 : diff -r ebd02fba267b https://code.google.com/p/go/ #
MessagesTotal messages: 4
|