Skip to content

Commit

Permalink
[embind] Remove init_embind. NFC (emscripten-core#22705)
Browse files Browse the repository at this point in the history
All this function was doing was exporting a bunch of library methods. If
folks want to export these functions they can do it themselves using the
normal mechanisms.
  • Loading branch information
sbc100 authored Oct 9, 2024
1 parent ad9210e commit 9eb7763
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ See docs/process.md for more on how version tagging works.
- Fix regression introduced in 3.1.67 (#22557) which broke webgpu / int64
integration. (#22689)
- SDL2 port updated from 2.28.4 to 2.30.8. (#22697)
- embind no longer exports any library functions by default. Previously we
would export getInheritedInstanceCount, getLiveInheritedInstances,
flushPendingDeletes and setDelayFunction. If you need these library function
exprted they can be added to `EXPORTED_RUNTIME_METHODS`. (#22705)

3.1.68 - 09/30/24
-----------------
Expand Down
13 changes: 2 additions & 11 deletions src/embind/embind.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ var LibraryEmbind = {
}`,
$EmValOptionalType__deps: ['$EmValType'],
$EmValOptionalType: '=Object.assign({optional: true}, EmValType);',
$init_embind__deps: [
'$getInheritedInstanceCount', '$getLiveInheritedInstances',
'$flushPendingDeletes', '$setDelayFunction'],
$init_embind__postset: 'init_embind();',
$init_embind: () => {
Module['getInheritedInstanceCount'] = getInheritedInstanceCount;
Module['getLiveInheritedInstances'] = getLiveInheritedInstances;
Module['flushPendingDeletes'] = flushPendingDeletes;
Module['setDelayFunction'] = setDelayFunction;
},

$throwUnboundTypeError__deps: ['$registeredTypes', '$typeDependencies', '$UnboundTypeError', '$getTypeName'],
$throwUnboundTypeError: (message, types) => {
Expand Down Expand Up @@ -219,7 +209,6 @@ var LibraryEmbind = {
},

// raw pointer -> instance
$registeredInstances__deps: ['$init_embind'],
$registeredInstances: {},

$getBasestPointer__deps: ['$throwBindingError'],
Expand Down Expand Up @@ -1582,6 +1571,8 @@ var LibraryEmbind = {
'$releaseClassHandle',
'$throwBindingError',
'$detachFinalizer',
'$flushPendingDeletes',
'$delayFunction',
],
$init_ClassHandle: () => {
Object.assign(ClassHandle.prototype, {
Expand Down
2 changes: 1 addition & 1 deletion test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -3240,7 +3240,7 @@ def test_embind(self, *extra_args):
'-Wno-deprecated-declarations',
'-lembind',
'-sRETAIN_COMPILER_SETTINGS',
'-sEXPORTED_RUNTIME_METHODS=getCompilerSetting',
'-sEXPORTED_RUNTIME_METHODS=getCompilerSetting,setDelayFunction,flushPendingDeletes',
'-sWASM_ASYNC_COMPILATION=0',
# This test uses a `CustomSmartPtr` class which has 1MB of data embedded in
# it which means we need more stack space than normal.
Expand Down
1 change: 1 addition & 0 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,7 @@ def run_embind_gen(wasm_target, js_syms, extra_settings, linker_inputs):
if building.is_wasm_dylib(linker_input):
safe_copy(linker_input, in_temp(''))

settings.EXPORTED_RUNTIME_METHODS = []
# Ignore any options or settings that can conflict with running the TS
# generation output.
# Don't invoke the program's `main` function.
Expand Down

0 comments on commit 9eb7763

Please sign in to comment.