v2 / vlib / v / tests / pointers / manual_free_stack_value_test.v
14 lines · 11 sloc · 179 bytes · a53626544a7ee19113a75b1cc0dd80586c49a9a3
Raw
1module main
2
3struct Hc256 {}
4
5@[unsafe]
6fn (mut h Hc256) free() {
7 unsafe { free(h) }
8}
9
10fn test_manual_free_stack_value() {
11 mut h := Hc256{}
12 unsafe { h.free() }
13 assert true
14}
15