------------------------------------------ implement zero-copy writer ------------------------------------------ Malloc implements Connection.
(n int)
| 242 | |
| 243 | // Malloc implements Connection. |
| 244 | func (c *connection) Malloc(n int) (buf []byte, err error) { |
| 245 | if !c.IsActive() { |
| 246 | return nil, Exception(ErrConnClosed, "when malloc") |
| 247 | } |
| 248 | return c.outputBuffer.Malloc(n) |
| 249 | } |
| 250 | |
| 251 | // MallocLen implements Connection. |
| 252 | func (c *connection) MallocLen() (length int) { |