Skip to content

Commit f1144ef

Browse files
committed
Use proper ffi.RTLD_LAZY flag with cffi
1 parent cbefd80 commit f1144ef

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ ut_ffi.cdef('extern void say_walk( void* owner);')
9595
ut_ffi.cdef('extern void release( void* obj);')
9696
# etc.
9797

98-
ut_dll = ut_ffi.dlopen('c:/path/to/test_native_library.dll', 1) # Lazy loading
98+
ut_dll = ut_ffi.dlopen('c:/path/to/test_native_library.dll', ut_ffi.RTLD_LAZY) # Lazy loading
9999

100100
class CustomCffiNativeHandle(CffiNativeHandle):
101101
def __init__(self, pointer, prior_ref_count = 0):

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ut_ffi.cdef('extern void say_walk( void* owner);')
9292
ut_ffi.cdef('extern void release( void* obj);')
9393
# etc.
9494

95-
ut_dll = ut_ffi.dlopen('c:/path/to/test_native_library.dll', 1) # Lazy loading
95+
ut_dll = ut_ffi.dlopen('c:/path/to/test_native_library.dll', ut_ffi.RTLD_LAZY) # Lazy loading
9696

9797
class CustomCffiNativeHandle(CffiNativeHandle):
9898
def __init__(self, pointer, prior_ref_count = 0):

refcount/interop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CffiNativeHandle(NativeHandle):
3939
void* create_some_object();
4040
dispose_of_some_object(void* obj);
4141
''')
42-
mydll_so = ffi.dlopen('/path/to/mydll.so')
42+
mydll_so = ffi.dlopen('/path/to/mydll.so', ffi.RTLD_LAZY)
4343
cffi_void_ptr = mydll_so.create_some_object()
4444
```
4545

tests/test_native_handle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
ut_ffi.cdef("extern void register_exception_callback(const void* callback);")
8686
ut_ffi.cdef("extern void trigger_callback();")
8787

88-
ut_dll = ut_ffi.dlopen(native_lib_path, 1) # Lazy loading
88+
ut_dll = ut_ffi.dlopen(native_lib_path, ut_ffi.RTLD_LAZY) # Lazy loading
8989

9090
_message_from_c: str = "<none>"
9191

0 commit comments

Comments
 (0)