-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
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
避免内存逃逸 #38
避免内存逃逸 #38
Conversation
name: name, | ||
data: data, | ||
} | ||
} | ||
|
||
// Abort event loop exec | ||
func (e *BasicEvent) Abort(abort bool) { | ||
func (e BasicEvent) Abort(abort bool) { | ||
e.aborted = abort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处修改会导致设置的值不生效吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯.这里漏考虑了
e.aborted = abort | ||
} | ||
|
||
// Fill event data | ||
func (e *BasicEvent) Fill(target interface{}, data M) *BasicEvent { | ||
func (e BasicEvent) Fill(target interface{}, data M) BasicEvent { | ||
if data != nil { | ||
e.data = data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非指针不能这么赋值吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是有点问题,单元测试过不了了。
未修改前:
修改后: