@@ -368,29 +368,31 @@ public:
368368 wasmtime_config_wasm_memory64_set (ptr.get (), enable);
369369 }
370370
371- // / \brief Configures whether the WebAssembly Garbage Collection proposal will be enabled
371+ // / \brief Configures whether the WebAssembly Garbage Collection proposal will
372+ // / be enabled
372373 // /
373374 // / https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_gc
374- void wasm_gc (bool enable) {
375- wasmtime_config_wasm_gc_set (ptr.get (), enable);
376- }
375+ void wasm_gc (bool enable) { wasmtime_config_wasm_gc_set (ptr.get (), enable); }
377376
378- // / \brief Configures whether the WebAssembly function references proposal will be enabled
377+ // / \brief Configures whether the WebAssembly function references proposal
378+ // / will be enabled
379379 // /
380380 // / https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_function_references
381381 void wasm_function_references (bool enable) {
382382 wasmtime_config_wasm_function_references_set (ptr.get (), enable);
383383 }
384384
385- // / \brief Configures whether the WebAssembly wide arithmetic proposal will be enabled
385+ // / \brief Configures whether the WebAssembly wide arithmetic proposal will be
386+ // / enabled
386387 // /
387388 // / https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_wide_arithmetic
388389 void wasm_wide_arithmetic (bool enable) {
389390 wasmtime_config_wasm_wide_arithmetic_set (ptr.get (), enable);
390391 }
391392
392393#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
393- // / \brief Configures whether the WebAssembly component model proposal will be enabled
394+ // / \brief Configures whether the WebAssembly component model proposal will be
395+ // / enabled
394396 // /
395397 // / https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_component_model
396398 void wasm_component_model (bool enable) {
@@ -399,7 +401,8 @@ public:
399401#endif // WASMTIME_FEATURE_COMPONENT_MODEL
400402
401403#ifdef WASMTIME_FEATURE_PARALLEL_COMPILATION
402- // / \brief Configure whether wasmtime should compile a module using multiple threads.
404+ // / \brief Configure whether wasmtime should compile a module using multiple
405+ // / threads.
403406 // /
404407 // / https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.parallel_compilation
405408 void parallel_compilation (bool enable) {
@@ -468,7 +471,8 @@ public:
468471 wasmtime_config_memory_reservation_set (ptr.get (), size);
469472 }
470473
471- // / \brief Configures the size of the bytes to reserve beyond the end of linear memory to grow into.
474+ // / \brief Configures the size of the bytes to reserve beyond the end of
475+ // / linear memory to grow into.
472476 // /
473477 // / https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.memory_reservation_for_growth
474478 void memory_reservation_for_growth (size_t size) {
@@ -482,7 +486,8 @@ public:
482486 wasmtime_config_memory_guard_size_set (ptr.get (), size);
483487 }
484488
485- // / \brief Configures whether the base pointer of linear memory is allowed to move.
489+ // / \brief Configures whether the base pointer of linear memory is allowed to
490+ // / move.
486491 // /
487492 // / https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.memory_may_move
488493 void memory_may_move (bool enable) {
@@ -535,13 +540,13 @@ public:
535540#endif // WASMTIME_FEATURE_CACHE
536541
537542private:
538- template <typename T>
539- static void raw_finalize (void *env) {
543+ template <typename T> static void raw_finalize (void *env) {
540544 std::unique_ptr<T> ptr (reinterpret_cast <T *>(env));
541545 }
542546
543547 template <typename M>
544- static uint8_t *raw_get_memory (void *env, size_t *byte_size, size_t *byte_capacity) {
548+ static uint8_t *raw_get_memory (void *env, size_t *byte_size,
549+ size_t *byte_capacity) {
545550 M *memory = reinterpret_cast <M *>(env);
546551 return memory->get_memory (byte_size, byte_capacity);
547552 }
@@ -556,19 +561,16 @@ private:
556561 }
557562
558563 template <typename T>
559- static wasmtime_error_t *raw_new_memory (
560- void *env, const wasm_memorytype_t *ty, size_t minimum, size_t maximum ,
561- size_t reserved_size_in_bytes , size_t guard_size_in_bytes ,
562- wasmtime_linear_memory_t *memory_ret)
563- {
564+ static wasmtime_error_t *
565+ raw_new_memory ( void *env, const wasm_memorytype_t *ty, size_t minimum,
566+ size_t maximum , size_t reserved_size_in_bytes ,
567+ size_t guard_size_in_bytes,
568+ wasmtime_linear_memory_t *memory_ret) {
564569 using Memory = typename T::Memory;
565570 T *creator = reinterpret_cast <T *>(env);
566- Result<Memory> result = creator->new_memory (
567- MemoryType::Ref (ty),
568- minimum,
569- maximum,
570- reserved_size_in_bytes,
571- guard_size_in_bytes);
571+ Result<Memory> result =
572+ creator->new_memory (MemoryType::Ref (ty), minimum, maximum,
573+ reserved_size_in_bytes, guard_size_in_bytes);
572574 if (!result) {
573575 return result.err ().release ();
574576 }
@@ -581,22 +583,19 @@ private:
581583 }
582584
583585public:
584-
585586 // / \brief Configures a custom memory creator for this configuration and
586587 // / eventual Engine.
587588 // /
588589 // / This can be used to use `creator` to allocate linear memories for the
589590 // / engine that this configuration will be used for.
590- template <typename T>
591- void host_memory_creator (T creator) {
591+ template <typename T> void host_memory_creator (T creator) {
592592 wasmtime_memory_creator_t config = {0 };
593- config.env = std::make_unique<T>(creator).release ();
593+ config.env = std::make_unique<T>(creator).release ();
594594 config.finalizer = raw_finalize<T>;
595595 config.new_memory = raw_new_memory<T>;
596596 wasmtime_config_host_memory_creator_set (ptr.get (), &config);
597597 }
598598
599-
600599#ifdef WASMTIME_FEATURE_POOLING_ALLOCATOR
601600 // / \brief Enables and configures the pooling allocation strategy.
602601 // /
0 commit comments