unsafe fn gen_new_dict_with_capacity(
        &mut self,
        builder: LLVMBuilderRef,
        intrinsics: &mut Intrinsics,
        capacity: LLVMValueRef,
        run: LLVMValueRef,
    ) -> LLVMValueRef {
        let alloc_size = LLVMBuildNSWMul(
            builder,
            capacity,
            self.size_of(self.slot_ty.slot_ty),
            c_str!(""),
        );
        let bytes = intrinsics.call_weld_run_malloc(builder, run, alloc_size, None);
        let _ = intrinsics.call_memset_zero(builder, bytes, alloc_size);
        let slot_array = LLVMBuildBitCast(
            builder,
            bytes,
            LLVMPointerType(self.slot_ty.slot_ty, 0),
            c_str!(""),
        );

        let mut dict = LLVMGetUndef(self.dict_inner_ty);
        dict = LLVMBuildInsertValue(builder, dict, slot_array, SLOT_ARR_INDEX, c_str!(""));
        dict = LLVMBuildInsertValue(builder, dict, capacity, CAP_INDEX, c_str!(""));
        dict = LLVMBuildInsertValue(builder, dict, self.i64(0), SIZE_INDEX, c_str!(""));
        dict
    }
Returns a new dictionary with the given capacity.
weld/src/codegen/llvm2/dict.rs