Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-40602: Rename hashtable.h to pycore_hashtable.h #20044

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
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-40602: Rename hashtable.h to pycore_hashtable.h
* Move Modules/hashtable.h to Include/internal/pycore_hashtable.h
* Move Modules/hashtable.c to Python/hashtable.c
* Python is now linked to hashtable.c. _tracemalloc is no longer
  linked to hashtable.c. Previously, marshal.c got hashtable.c via
  _tracemalloc.c which is built as a builtin module.
  • Loading branch information
vstinner committed May 12, 2020
commit 1b03fa2f74c3a740316e1b3e8cedd5ba8e4902f1
17 changes: 12 additions & 5 deletions 17 Modules/hashtable.h → Include/internal/pycore_hashtable.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#ifndef Py_HASHTABLE_H
#define Py_HASHTABLE_H
/* The whole API is private */
#ifndef Py_LIMITED_API
#ifndef Py_INTERNAL_HASHTABLE_H
#define Py_INTERNAL_HASHTABLE_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif

/* Single linked list */

Expand Down Expand Up @@ -207,5 +212,7 @@ PyAPI_FUNC(int) _Py_hashtable_pop(
_Py_hashtable_pop(TABLE, sizeof(KEY), &(KEY), sizeof(DATA), &(DATA))


#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_HASHTABLE_H */
2 changes: 2 additions & 0 deletions 2 Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ PYTHON_OBJS= \
Python/getversion.o \
Python/graminit.o \
Python/hamt.o \
Python/hashtable.o \
Python/import.o \
Python/importdl.o \
Python/initconfig.o \
Expand Down Expand Up @@ -1131,6 +1132,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/internal/pycore_getopt.h \
$(srcdir)/Include/internal/pycore_gil.h \
$(srcdir)/Include/internal/pycore_hamt.h \
$(srcdir)/Include/internal/pycore_hashtable.h \
$(srcdir)/Include/internal/pycore_import.h \
$(srcdir)/Include/internal/pycore_initconfig.h \
$(srcdir)/Include/internal/pycore_interp.h \
Expand Down
2 changes: 1 addition & 1 deletion 2 Modules/Setup
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ faulthandler faulthandler.c
#
# bpo-35053: The module must be builtin since _Py_NewReference()
# can call _PyTraceMalloc_NewReference().
_tracemalloc _tracemalloc.c hashtable.c
_tracemalloc _tracemalloc.c

# PEG-based parser module -- slated to be *the* parser
_peg_parser _peg_parser.c
Expand Down
2 changes: 1 addition & 1 deletion 2 Modules/_tracemalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "pycore_gc.h" // PyGC_Head
#include "pycore_pymem.h" // _Py_tracemalloc_config
#include "pycore_traceback.h"
#include "hashtable.h"
#include "pycore_hashtable.h"
#include "frameobject.h" // PyFrame_GetBack()

#include "clinic/_tracemalloc.c.h"
Expand Down
3 changes: 2 additions & 1 deletion 3 PCbuild/pythoncore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
<ClInclude Include="..\Include\internal\pycore_getopt.h" />
<ClInclude Include="..\Include\internal\pycore_gil.h" />
<ClInclude Include="..\Include\internal\pycore_hamt.h" />
<ClInclude Include="..\Include\internal\pycore_hashtable.h" />
<ClInclude Include="..\Include\internal\pycore_import.h" />
<ClInclude Include="..\Include\internal\pycore_initconfig.h" />
<ClInclude Include="..\Include\internal\pycore_interp.h" />
Expand Down Expand Up @@ -335,7 +336,6 @@
<ClCompile Include="..\Modules\errnomodule.c" />
<ClCompile Include="..\Modules\faulthandler.c" />
<ClCompile Include="..\Modules\gcmodule.c" />
<ClCompile Include="..\Modules\hashtable.c" />
<ClCompile Include="..\Modules\itertoolsmodule.c" />
<ClCompile Include="..\Modules\main.c" />
<ClCompile Include="..\Modules\mathmodule.c" />
Expand Down Expand Up @@ -462,6 +462,7 @@
<ClCompile Include="..\Python\getversion.c" />
<ClCompile Include="..\Python\graminit.c" />
<ClCompile Include="..\Python\hamt.c" />
<ClCompile Include="..\Python\hashtable.c" />
<ClCompile Include="..\Python\import.c" />
<ClCompile Include="..\Python\importdl.c" />
<ClCompile Include="..\Python\initconfig.c" />
Expand Down
9 changes: 6 additions & 3 deletions 9 PCbuild/pythoncore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@
<ClInclude Include="..\Include\internal\pycore_hamt.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\internal\pycore_hashtable.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\internal\pycore_import.h">
<Filter>Include</Filter>
</ClInclude>
Expand Down Expand Up @@ -1034,6 +1037,9 @@
<ClCompile Include="..\Python\hamt.h">
<Filter>Python</Filter>
</ClCompile>
<ClCompile Include="..\Python\hashtable.c">
<Filter>Modules</Filter>
</ClCompile>
<ClCompile Include="..\Python\import.c">
<Filter>Python</Filter>
</ClCompile>
Expand Down Expand Up @@ -1142,9 +1148,6 @@
<ClCompile Include="..\Modules\_tracemalloc.c">
<Filter>Modules</Filter>
</ClCompile>
<ClCompile Include="..\Modules\hashtable.c">
<Filter>Modules</Filter>
</ClCompile>
<ClCompile Include="..\PC\invalid_parameter_handler.c">
<Filter>PC</Filter>
</ClCompile>
Expand Down
2 changes: 1 addition & 1 deletion 2 Modules/hashtable.c → Python/hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*/

#include "Python.h"
#include "hashtable.h"
#include "pycore_hashtable.h"

#define HASHTABLE_MIN_SIZE 16
#define HASHTABLE_HIGH 0.50
Expand Down
2 changes: 1 addition & 1 deletion 2 Python/marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "longintrepr.h"
#include "code.h"
#include "marshal.h"
#include "../Modules/hashtable.h"
#include "pycore_hashtable.h"

/*[clinic input]
module marshal
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.