[SR-11231] ManagedBufferPointer's suggested deinit allocates #53632
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: e993d878672cad630fee8e5c33c63d03
relates to:
Issue Description:
ManagedBufferPointer's docs suggest to use it this way:
From this, I created a simple demo (not super useful but...)
The expectation (the whole point of
ManagedBufferPointer
really) would be that this allocates only once per use ofMyBuffer
. But looking at dtrace:we can see a pattern here: There's
2
allocations per allocation ofMyBuffer
which defeats the purpose of usingManagedBufferPointer
altogether. We can also use dtrace to figure out where exactly those allocs are coming from:The expected allocations come from (as expected):
the unexpected ones seem to come from
MyBuffer
'sdeinit
:This looks like a coroutine allocation?
The text was updated successfully, but these errors were encountered: