UnsafeMutableBufferPointer missing deinitialize()

It seems that there is no deinitialize() method for UnsafeMutableBufferPointer. Is this an oversight, or is there a technical reason behind it? For example there is a dedicated deallocate() method for UnsafeMutableBufferPointer.

Greetings,
Johannes

1 Like

Neither! It just hasn’t been designed yet. See discussion in SE-0184.

cc @taylorswift

1 Like

i think the main thing blocking UnsafeMutableBufferPointer.deinitialize() was that you usually don’t want to deinitialize the entire buffer at once, since if you’re using the unsafe buffer apis you’re probably doing some sort of manual memory management, which means you would be initializing and deinitializing sections of the buffer instead of the whole thing. but 3 years ago no one could agree on how these partial-initialization apis should work. so it kind of got dropped

here was the original se-0184-b thread:

some of the email text got corrupted when it got imported into the forums (back then there were no swift forums) but the gist of it is still there

thanks kelvin for the link :+1:

Terms of Service

Privacy Policy

Cookie Policy