Skip to content

Commit 257c0c9

Browse files
committed
Allow customizing the instance name
1 parent ca7cdf5 commit 257c0c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/rlbox_wasm2c_sandbox.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ class rlbox_wasm2c_sandbox
522522
*/
523523
inline bool impl_create_sandbox(
524524
bool infallible = true,
525-
const w2c_mem_capacity* custom_capacity = nullptr)
525+
const w2c_mem_capacity* custom_capacity = nullptr,
526+
const char* instance_name = nullptr)
526527
{
527528
FALLIBLE_DYNAMIC_CHECK(
528529
infallible, instance_initialized == false, "Sandbox already initialized");
@@ -556,7 +557,7 @@ class rlbox_wasm2c_sandbox
556557
INVOKE_DEFINE_RLBOX_WASM2C_IMPORTED_MODULE_ATTRIBS(RLBOX_WASM2C_MODULE_NAME);
557558

558559
*sandbox_memory_info = create_wasm2c_memory(
559-
*initial_memory_pages, custom_capacity, "RLBox_wasm2c" /* name */);
560+
*initial_memory_pages, custom_capacity, instance_name? instance_name : "RLBox_wasm2c");
560561
FALLIBLE_DYNAMIC_CHECK(infallible,
561562
sandbox_memory_info->data != nullptr,
562563
"Could not allocate a heap for the wasm2c sandbox");

0 commit comments

Comments
 (0)