#Help understanding new interfaces

1 messages · Page 1 of 1 (latest)

jolly dagger
#

(I used the master tag because theres no tag for 0.15)

So, in 0.15 std.Arraylist, you pass an allocator in the .append() method. but during .deinit(), it requires a single allocator.
What happens if .append() was called with multiple diffirent allocators, and then .deinit() is called with only a single allocator?

past notch
#

interacting with an allocation using a different allocator than it was allocated with is illegal.
while the 'new' api makes this footgun easier, it is still considered very easy to avoid.

#

'new' because the it already existed as ArrayListUnmanaged, and the 'old' api still exists as array_list.Managed though it is deprecated and will be removed.
The default was just changed