8000 Updated CXX, fixes ~300MB of memory leaks in tests · matplotlib/matplotlib@749f295 · GitHub
[go: up one dir, main page]

Skip to content

Commit 749f295

Browse files
ivanovastropy-buildbot
authored andcommitted
Updated CXX, fixes ~300MB of memory leaks in tests
2 parents 9046990 + 2c67fb2 commit 749f295

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

CXX/Python2/Objects.hxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ namespace Py
20592059

20602060
String decode( const char *encoding, const char *error="strict" )
20612061
{
2062-
return Object( PyString_AsDecodedObject( ptr(), encoding, error ) );
2062+
return Object( PyString_AsDecodedObject( ptr(), encoding, error ), true );
20632063
}
20642064

20652065
// Queries
@@ -2208,17 +2208,17 @@ namespace Py
22082208
{
22092209
if( isUnicode() )
22102210
{
2211-
return String( PyUnicode_AsEncodedString( ptr(), encoding, error ) );
2211+
return String( PyUnicode_AsEncodedString( ptr(), encoding, error ), true );
22122212
}
22132213
else
22142214
{
2215-
return String( PyString_AsEncodedObject( ptr(), encoding, error ) );
2215+
return String( PyString_AsEncodedObject( ptr(), encoding, error ), true );
22162216
}
22172217
}
22182218

22192219
String decode( const char *encoding, const char *error="strict" )
22202220
{
2221-
return Object( PyString_AsDecodedObject( ptr(), encoding, error ) );
2221+
return Object( PyString_AsDecodedObject( ptr(), encoding, error ), true );
22222222
}
22232223

22242224
// Queries

CXX/Python3/ExtensionModule.hxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ namespace Py
8282
extern "C" PyObject *method_varargs_call_handler( PyObject *_self_and_name_tuple, PyObject *_args );
8383
extern "C" PyObject *method_keyword_call_handler( PyObject *_self_and_name_tuple, PyObject *_args, PyObject *_keywords );
8484

85-
extern "C" void do_not_dealloc( void * );
86-
8785
template<TEMPLATE_TYPENAME T>
8886
class ExtensionModule : public ExtensionModuleBase
8987
{

CXX/Python3/ExtensionOldType.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ namespace Py
237237
T *self = static_cast<T *>( self_in_cobject );
238238

239239
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>(
240-
PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL ) );
240+
PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL ) );
241241

242242
Object result;
243243

@@ -273,7 +273,7 @@ namespace Py
273273
PyObject *self_in_cobject = self_and_name_tuple[0].ptr();
274274
T *self = static_cast<T *>( self_in_cobject );
275275
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>(
276-
PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL ) );
276+
PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL ) );
277277

278278
Tuple args( _args );
279279

@@ -310,7 +310,7 @@ namespace Py
310310
PyObject *self_in_cobject = self_and_name_tuple[0].ptr();
311311
T *self = static_cast<T *>( self_in_cobject );
312312
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>(
313-
PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL ) );
313+
PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL ) );
314314

315315
Tuple args( _args );
316316

CXX/Python3/Objects.hxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,7 +2018,7 @@ namespace Py
20182018
}
20192019

20202020
String()
2021-
: SeqBase<Char>( PyUnicode_FromString( "" ), true )
2021+
: SeqBase<Char>( PyUnicode_FromString( "" ) )
20222022
{
20232 C02E 023
validate();
20242024
}
@@ -2059,19 +2059,19 @@ namespace Py
20592059
20602060
*/
20612061
String( const std::string &s, const char *encoding, const char *errors=NULL )
2062-
: SeqBase<Char>( PyUnicode_Decode( s.c_str(), s.size(), encoding, errors ) )
2062+
: SeqBase<Char>( PyUnicode_Decode( s.c_str(), s.size(), encoding, errors ), true )
20632063
{
20642064
validate();
20652065
}
20662066

20672067
String( const char *s, const char *encoding, const char *errors=NULL )
2068-
: SeqBase<Char>( PyUnicode_Decode( s, strlen(s), encoding, errors ) )
2068+
: SeqBase<Char>( PyUnicode_Decode( s, strlen(s), encoding, errors ), true )
20692069
{
20702070
validate();
20712071
}
20722072

20732073
String( const char *s, Py_ssize_t size, const char *encoding, const char *errors=NULL )
2074-
: SeqBase<Char>( PyUnicode_Decode( s, size, encoding, errors ) )
2074+
: SeqBase<Char>( PyUnicode_Decode( s, size, encoding, errors ), true )
20752075
{
20762076
validate();
20772077
}
@@ -2104,7 +2104,7 @@ namespace Py
21042104
// Encode
21052105
Bytes encode( const char *encoding, const char *error="strict" ) const
21062106
{
2107-
return Bytes( PyUnicode_AsEncodedString( ptr(), encoding, error ) );
2107+
return Bytes( PyUnicode_AsEncodedString( ptr(), encoding, error ), true );
21082108
}
21092109

21102110
// Queries

CXX/Version.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
#define PYCXX_VERSION_MAJOR 6
4242
#define PYCXX_VERSION_MINOR 2
43-
#define PYCXX_VERSION_PATCH 2
43+
#define PYCXX_VERSION_PATCH 4
4444
#define PYCXX_MAKEVERSION( major, minor, patch ) ((major<<16)|(minor<<8)|(patch))
4545
#define PYCXX_VERSION PYCXX_MAKEVERSION( PYCXX_VERSION_MAJOR, PYCXX_VERSION_MINOR, PYCXX_VERSION_PATCH )
4646
#endif

0 commit comments

Comments
 (0)
0