Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit b5e9ae8

Browse files
samskalickySkalicky
andauthored
[v1.9.x] stop closing opened libs (#20523)
* stopped closing opened libs * removed return handling from load * missed one *lib Co-authored-by: Skalicky <sskalic@3c22fb4b1091.ant.amazon.com>
1 parent 524be2f commit b5e9ae8

5 files changed

Lines changed: 5 additions & 7 deletions

File tree

include/mxnet/c_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ MXNET_DLL const char *MXGetLastError();
233233
/*!
234234
* \brief Load library dynamically
235235
* \param path to the library .so file
236-
* \param 0 for quiet, 1 for verbose
236+
* \param verbose 0 for quiet, 1 for verbose
237237
* \return 0 when success, -1 when failure happens.
238238
*/
239239
MXNET_DLL int MXLoadLib(const char *path, unsigned verbose);

python/mxnet/library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def load(path, verbose=True):
3737
3838
Returns
3939
---------
40-
void
40+
None
4141
"""
4242
#check if path exists
4343
if not os.path.exists(path):

src/c_api/c_api.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,8 @@ void registerPasses(void *lib, int verbose, mxnet::ext::msgSize_t msgSize,
15141514
/*!
15151515
* \brief Loads dynamic custom library and initializes it
15161516
* \param path library path
1517+
* \param verbose 0 for quiet, 1 for verbose
1518+
* \return 0 when success, -1 when failure happens.
15171519
*/
15181520
int MXLoadLib(const char *path, unsigned verbose) {
15191521
API_BEGIN();

src/initialize.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ LibraryInitializer::LibraryInitializer()
9696
install_pthread_atfork_handlers();
9797
}
9898

99-
LibraryInitializer::~LibraryInitializer() {
100-
close_open_libs();
101-
}
102-
10399
bool LibraryInitializer::lib_is_loaded(const std::string& path) const {
104100
return loaded_libs.count(path) > 0;
105101
}

src/initialize.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class LibraryInitializer {
5656
*/
5757
LibraryInitializer();
5858

59-
~LibraryInitializer();
59+
~LibraryInitializer() = default;
6060

6161
/**
6262
* @return true if the current pid doesn't match the one that initialized the library

0 commit comments

Comments
 (0)