We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong pool unmarshal size.
my proto file:
// protoc --go_out=. --plugin protoc-gen-go="/Users/jie.yang05/go/bin/protoc-gen-go" --go-vtproto_out=. --plugin protoc-gen-go-vtproto="/Users/jie.yang05/go/bin/protoc-gen-go-vtproto" --go-vtproto_opt=features=marshal+unmarshal+size+pool ./lineentry.proto syntax = "proto3"; package index; option go_package="./proto"; import "github.com/planetscale/vtprotobuf/vtproto/ext.proto"; message lineEntries { option (vtproto.mempool) = true; // Enable memory pooling repeated lineEntry lineEntries = 1; } message lineEntry { uint64 address = 1; uint32 line = 2; uint32 file = 3; }
comand
yangjie05-mac:index jie.yang05$ protoc --go_out=. --plugin protoc-gen-go="/Users/jie.yang05/go/bin/protoc-gen-go" --go-vtproto_out=. --plugin protoc-gen-go-vtproto="/Users/jie.yang05/go/bin/protoc-gen-go-vtproto" -I /Users/jie.yang05/go/pkg/mod/github.com/planetscale/vtprotobuf\@v0.4.0/include -I ./ ./lineentry.proto
generate code:
func (m *LineEntries) ResetVT() { for _, mm := range m.LineEntries { mm.ResetVT() } m.Reset() } func (m *LineEntries) ReturnToVTPool() { if m != nil { m.ResetVT() vtprotoPool_LineEntries.Put(m) } }
generate code have wrong ResetVT.
The text was updated successfully, but these errors were encountered:
Can you elaborate a little bit, please? What's wrong with the ResetVT in your generated code?
ResetVT
Sorry, something went wrong.
it should add a line:
m.lineEntries = m.lineEntries[:0]
Oh I see what you mean. This is a known bug that was fixed in the latest release: https://github.com/planetscale/vtprotobuf/releases/tag/v0.5.0
Can you try updating vtprotobuf to see if the generated code looks correct now? Thanks!
vtprotobuf
No branches or pull requests
wrong pool unmarshal size.
my proto file:
comand
generate code:
generate code have wrong ResetVT.
The text was updated successfully, but these errors were encountered: