Sha256: fb7633b928825be8813291bef021f72ae01fea4950bc72896418ca22eba9d70d
Contents?: true
Size: 458 Bytes
Versions: 19
Compression:
Stored size: 458 Bytes
Contents
use magnus::eval; // this will fail if the allocator calls Ruby, like with rb-sys's // global-allocator feature #[test] fn can_allocate_before_ruby_init() { // allocate something let x: Vec<i64> = (0..256).collect(); // *then* init Ruby let ruby = unsafe { magnus::embed::init() }; // do something with allocated data to ensure it's not optimised away let res: i64 = eval!(ruby, "x.sum", x).unwrap(); assert_eq!(res, 32640); }
Version data entries
19 entries across 19 versions & 1 rubygems