mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
new new & make
R=r OCL=22166 CL=22166
This commit is contained in:
parent
9662e7b2db
commit
5564504507
113 changed files with 363 additions and 364 deletions
|
|
@ -46,7 +46,7 @@ type P struct {
|
|||
}
|
||||
|
||||
func Printer() *P {
|
||||
p := new(*P);
|
||||
p := new(P);
|
||||
p.fmt = fmt.New();
|
||||
return p;
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ func (p *P) ensure(n int) {
|
|||
if newn < n {
|
||||
newn = n + AllocSize
|
||||
}
|
||||
b := new([]byte, newn);
|
||||
b := make([]byte, newn);
|
||||
for i := 0; i < p.n; i++ {
|
||||
b[i] = p.buf[i];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue