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

Fix undefined sanitizer issue in compact_array #284

Merged
merged 2 commits into from
Nov 28, 2022
Merged

Conversation

MBkkt
Copy link
Contributor

@MBkkt MBkkt commented Nov 22, 2022

Also I think really correct code, should start with non zero capacity (so correct capacity can be seted in ctor)

@MBkkt MBkkt mentioned this pull request Nov 22, 2022
@MBkkt MBkkt changed the title Update compact_array.h Fix undefined sanitizer issue in compact_array.h Nov 22, 2022
@MBkkt MBkkt changed the title Fix undefined sanitizer issue in compact_array.h Fix undefined sanitizer issue in compact_array Nov 22, 2022
Co-authored-by: Valery Mironov <32071355+MBkkt@users.noreply.github.com>
@jmr
Copy link
Member

jmr commented Nov 28, 2022

Also I think really correct code, should start with non zero capacity (so correct capacity can be seted in ctor)

Why? Feel free to send another PR if you think there are more improvements.

@jmr jmr merged commit e15d00b into google:master Nov 28, 2022
@MBkkt
Copy link
Contributor Author

MBkkt commented Nov 28, 2022

Why? Feel free to send another PR if you think there are more improvements

Because we always have some capacity on "stack". Same as for sso string.

@jmr
Copy link
Member

jmr commented Nov 28, 2022

Because we always have some capacity on "stack". Same as for sso string.

I'm not sure what you mean. There's already inline SSO-like space allocated:

char inlined_elements_[3 - kUnusedPaddingBytes];

Send a PR to make it clear.

@MBkkt
Copy link
Contributor Author

MBkkt commented Nov 28, 2022

I mean sso string after default ctor have non zero capacity.
Why same not possible for this array?

@jmr
Copy link
Member

jmr commented Nov 28, 2022

Anything is possible. Send a PR if you think it can be improved.

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