the.bay.news

A question on memory

Ziggit
A question on memory
fn bar(allocator:std.mem.allocator) []Foo { var foo: []Foo = try allocator.alloc(Foo, 3); return foo[..2]; } with the above function, the function that calls bar frees the returned slice. question is, is this legal behavior, freeing a slice of a slice? would it properly free the original slice?

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.