Skip to content
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

add in ability to use pools for allocation #2

Merged
merged 1 commit into from
Oct 31, 2014

Conversation

whyrusleeping
Copy link
Collaborator

No description provided.

panic("Got invalid type from sync pool!")
}
return buf
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whyrusleeping add golint + go vet to your editor

    if s.BufPool == nil {
        return make([]byte, size)
    }
    bufi := s.BufPool.Get()
    buf, ok := bufi.([]byte)
    if !ok {
        panic("Got invalid type from sync pool!")
    }
    return buf

@jbenet
Copy link
Owner

jbenet commented Oct 31, 2014

LGTM, thanks!

jbenet added a commit that referenced this pull request Oct 31, 2014
add in ability to use pools for allocation
@jbenet jbenet merged commit ab0e7a0 into jbenet:master Oct 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants