File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -177,18 +177,18 @@ type BindableColumn struct {
177
177
Size int
178
178
Len BufferLen
179
179
Buffer []byte
180
- smallBuf [8 ]byte // small inline memory buffer, so we do not need allocate external memory all the time
181
180
}
182
181
182
+ // TODO(brainman): BindableColumn.Buffer is used by external code after external code returns - that needs to be avoided in the future
183
+
183
184
func NewBindableColumn (b * BaseColumn , ctype api.SQLSMALLINT , bufSize int ) * BindableColumn {
184
185
b .CType = ctype
185
186
c := & BindableColumn {BaseColumn : b , Size : bufSize }
186
- if c .Size <= len (c .smallBuf ) {
187
- // use inline buffer
188
- c .Buffer = c .smallBuf [:c .Size ]
189
- } else {
190
- c .Buffer = make ([]byte , c .Size )
187
+ l := 8 // always use small starting buffer
188
+ if c .Size > l {
189
+ l = c .Size
191
190
}
191
+ c .Buffer = make ([]byte , l )
192
192
return c
193
193
}
194
194
You can’t perform that action at this time.
0 commit comments