@@ -542,6 +542,228 @@ wasmtime_config_host_memory_creator_set(wasm_config_t *,
542
542
*/
543
543
WASMTIME_CONFIG_PROP (void , memory_init_cow , bool )
544
544
545
+ #ifdef WASMTIME_FEATURE_POOLING_ALLOCATOR
546
+
547
+ /**
548
+ * \brief A type containing configuration options for the pooling allocator.
549
+ *
550
+ * For more information see the Rust documentation at
551
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html
552
+ */
553
+ typedef struct wasmtime_pooling_allocation_config_t
554
+ wasmtime_pooling_allocation_config_t ;
555
+
556
+ /**
557
+ * \brief Creates a new pooling allocation configuration object. Must be
558
+ * deallocated with a call to wasmtime_pooling_allocation_config_delete.
559
+ */
560
+ WASM_API_EXTERN wasmtime_pooling_allocation_config_t *
561
+ wasmtime_pooling_allocation_config_new ();
562
+
563
+ /**
564
+ * \brief Deallocates a pooling allocation configuration object created with a
565
+ * call to wasmtime_pooling_allocation_config_new.
566
+ */
567
+ WASM_API_EXTERN void wasmtime_pooling_allocation_config_delete (
568
+ wasmtime_pooling_allocation_config_t * );
569
+
570
+ #define WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (name , ty ) \
571
+ WASM_API_EXTERN void wasmtime_pooling_allocation_config_##name##_set( \
572
+ wasmtime_pooling_allocation_config_t *, ty);
573
+
574
+ /**
575
+ * \brief Configures the maximum number of “unused warm slots” to retain in the
576
+ * pooling allocator.
577
+ *
578
+ * For more information see the Rust documentation at
579
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_unused_warm_slots.
580
+ */
581
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_unused_warm_slots , uint32_t )
582
+
583
+ /**
584
+ * \brief The target number of decommits to do per batch.
585
+ *
586
+ * For more information see the Rust documentation at
587
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.decommit_batch_size.
588
+ */
589
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (decommit_batch_size , size_t )
590
+
591
+ #ifdef WASMTIME_FEATURE_ASYNC
592
+ /**
593
+ * \brief How much memory, in bytes, to keep resident for async stacks allocated
594
+ * with the pooling allocator.
595
+ *
596
+ * For more information see the Rust documentation at
597
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.async_stack_keep_resident.
598
+ */
599
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (async_stack_keep_resident , size_t )
600
+ #endif
601
+
602
+ /**
603
+ * \brief How much memory, in bytes, to keep resident for each linear memory
604
+ * after deallocation.
605
+ *
606
+ * For more information see the Rust documentation at
607
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.linear_memory_keep_resident.
608
+ */
609
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (linear_memory_keep_resident , size_t )
610
+
611
+ /**
612
+ * \brief How much memory, in bytes, to keep resident for each table after
613
+ * deallocation.
614
+ *
615
+ * For more information see the Rust documentation at
616
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.table_keep_resident.
617
+ */
618
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (table_keep_resident , size_t )
619
+
620
+ /**
621
+ * \brief The maximum number of concurrent component instances supported
622
+ * (default is 1000).
623
+ *
624
+ * For more information see the Rust documentation at
625
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.total_component_instances.
626
+ */
627
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (total_component_instances , uint32_t )
628
+
629
+ /**
630
+ * \brief The maximum size, in bytes, allocated for a component instance’s
631
+ * VMComponentContext metadata.
632
+ *
633
+ * For more information see the Rust documentation at
634
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_component_instance_size.
635
+ */
636
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_component_instance_size , size_t )
637
+
638
+ /**
639
+ * \brief The maximum number of core instances a single component may contain
640
+ * (default is unlimited).
641
+ *
642
+ * For more information see the Rust documentation at
643
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_core_instances_per_component.
644
+ */
645
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_core_instances_per_component ,
646
+ uint32_t )
647
+
648
+ /**
649
+ * \brief The maximum number of Wasm linear memories that a single component may
650
+ * transitively contain (default is unlimited).
651
+ *
652
+ * For more information see the Rust documentation at
653
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_memories_per_component.
654
+ */
655
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_memories_per_component , uint32_t )
656
+
657
+ /**
658
+ * \brief The maximum number of tables that a single component may transitively
659
+ * contain (default is unlimited).
660
+ *
661
+ * For more information see the Rust documentation at
662
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_tables_per_component.
663
+ */
664
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_tables_per_component , uint32_t )
665
+
666
+ /**
667
+ * \brief The maximum number of concurrent Wasm linear memories supported
668
+ * (default is 1000).
669
+ *
670
+ * For more information see the Rust documentation at
671
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.total_memories.
672
+ */
673
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (total_memories , uint32_t )
674
+
675
+ /**
676
+ * \brief The maximum number of concurrent tables supported (default is 1000).
677
+ *
678
+ * For more information see the Rust documentation at
679
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.total_tables.
680
+ */
681
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (total_tables , uint32_t )
682
+
683
+ #ifdef WASMTIME_FEATURE_ASYNC
684
+ /**
685
+ * \brief The maximum number of execution stacks allowed for asynchronous
686
+ * execution, when enabled (default is 1000).
687
+ *
688
+ * For more information see the Rust documentation at
689
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.total_stacks.
690
+ */
691
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (total_stacks , uint32_t )
692
+ #endif
693
+
694
+ /**
695
+ * \brief The maximum number of concurrent core instances supported (default is
696
+ * 1000).
697
+ *
698
+ * For more information see the Rust documentation at
699
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.total_core_instances.
700
+ */
701
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (total_core_instances , uint32_t )
702
+
703
+ /**
704
+ * \brief The maximum size, in bytes, allocated for a core instance’s VMContext
705
+ * metadata.
706
+ *
707
+ * For more information see the Rust documentation at
708
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_core_instance_size.
709
+ */
710
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_core_instance_size , size_t )
711
+
712
+ /**
713
+ * \brief The maximum number of defined tables for a core module (default is 1).
714
+ *
715
+ * For more information see the Rust documentation at
716
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_tables_per_module.
717
+ */
718
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_tables_per_module , uint32_t )
719
+
720
+ /**
721
+ * \brief The maximum table elements for any table defined in a module (default
722
+ * is 20000).
723
+ *
724
+ * For more information see the Rust documentation at
725
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.table_elements.
726
+ */
727
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (table_elements , size_t )
728
+
729
+ /**
730
+ * \brief The maximum number of defined linear memories for a module (default is
731
+ * 1).
732
+ *
733
+ * For more information see the Rust documentation at
734
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_memories_per_module.
735
+ */
736
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_memories_per_module , uint32_t )
737
+
738
+ /**
739
+ * \brief The maximum byte size that any WebAssembly linear memory may grow to.
740
+ *
741
+ * For more information see the Rust documentation at
742
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.max_memory_size.
743
+ */
744
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (max_memory_size , size_t )
745
+
746
+ /**
747
+ * \brief The maximum number of concurrent GC heaps supported (default is 1000).
748
+ *
749
+ * For more information see the Rust documentation at
750
+ * https://docs.wasmtime.dev/api/wasmtime/struct.PoolingAllocationConfig.html#method.total_gc_heaps.
751
+ */
752
+ WASMTIME_POOLING_ALLOCATION_CONFIG_PROP (total_gc_heaps , uint32_t )
753
+
754
+ /**
755
+ * \brief Sets the Wasmtime allocation strategy to use the pooling allocator. It
756
+ * does not take ownership of the pooling allocation configuration object, which
757
+ * must be deleted with a call to wasmtime_pooling_allocation_config_delete.
758
+ *
759
+ * For more information see the Rust documentation at
760
+ * https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.allocation_strategy.
761
+ */
762
+ WASM_API_EXTERN void wasmtime_pooling_allocation_strategy_set (
763
+ wasm_config_t * , const wasmtime_pooling_allocation_config_t * );
764
+
765
+ #endif // WASMTIME_FEATURE_POOLING_ALLOCATOR
766
+
545
767
#ifdef __cplusplus
546
768
} // extern "C"
547
769
#endif
0 commit comments