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

test/func/malloc fixes #401

Merged
merged 1 commit into from
Oct 19, 2021
Merged

Conversation

nwf
Copy link
Collaborator

@nwf nwf commented Oct 18, 2021

  • check_result() abort() on null and non-nullptr result. Otherwise it
    just prints and doesn't end the test

  • Don't call realloc(, 0); this has never been consistent and the current C2x
    draft (see §7.22.3.5 and N2464) finally just declares it to be undefined
    behavior. POSIX (2017) tolerates our current behavior of freeing the
    passed-in pointer and returning a new object.

- `check_result()` `abort()` on `null` and non-`nullptr` result.  Otherwise it
  just prints and doesn't end the test

- Don't call `realloc(, 0)`; this has never been consistent and the current C2x
  draft (see §7.22.3.5 and N2464) finally just declares it to be undefined
  behavior.  POSIX (2017) tolerates our current behavior of freeing the
  passed-in pointer and returning a new object.
@nwf nwf requested a review from mjp41 October 18, 2021 16:11
@nwf nwf mentioned this pull request Oct 18, 2021
Copy link
Member

@mjp41 mjp41 left a comment

Choose a reason for hiding this comment

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

LGTM

@mjp41 mjp41 merged commit 1de28ee into microsoft:snmalloc2 Oct 19, 2021
@nwf nwf deleted the 202110-test_func_malloc-fixes branch December 16, 2021 19:28
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.

3 participants