Skip to content

Conversation

@MichaelChirico
Copy link
Contributor

I'm not sure if getting the buffer length precisely correct is crucial for this routine (untested), but I notice the buffer is almost always either size 44-45 so why not just pick one & make things easier?

table(buflen = ceiling(log(2**64 / log(2:36))))
# buflen
# 44 45 
# 32  3

Came across this because the code fails to compile under the -Wvla compiler option. That should be disabled here TBH -- the concern there is getting a stack overflow if the buffer request winds up inordinately large. But in this case the buffer size is very small --> unlikely to cause issues except under extreme memory pressure.

But anyway, we can make things easier on the compiler/etc if we have a constant here which I think should be possible.

To be clear: PR is a suggestion, so feel free to close.

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.

1 participant