Skip to content

gh-94087: Update function used to construct Unicode string (in doc and code) #94088

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

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

pamelafox
Copy link
Contributor

This PR updates unicode.rst so that it refers to PyMem_New instead of PyMem_Alloc, a seemingly non-existent function.

This PR also replaces the PyMem_NEW macro with a direct call to PyMem_New, since pymem.h claims PyMEM_NEW is a deprecated alias, and as far as I can tell, there is no reason not to use PyMem_New instead. The other parts of unicode.c use PyMem_New, not PyMem_NEW.

Here's the PyMem_NEW macro, for reference:
#define PyMem_NEW(type, n) PyMem_New(type, n)

I'm not an expert C programmer however so perhaps I'm missing something.

@zooba
Copy link
Member

zooba commented Jul 28, 2022

I think it meant to refer to PyMem_Malloc, but since it's using PyMem_New we may as well say so. The only difference is the calling convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants