Commit Graph

14 Commits

Author SHA1 Message Date
Dave Abrahams
35a2584024 [stdlib] Work around rdar://18619176
Force a use of the value addressor so the linker doesn't drop it.

Swift SVN r22952
2014-10-26 21:37:41 +00:00
Dave Abrahams
afe73f308f [stdlib] Disable a check on i386, where it breaks
Fix tracked by rdar://problem/18682097

Swift SVN r22811
2014-10-17 05:56:56 +00:00
Dave Abrahams
15f7847690 [stdlib] Disable a check on armv7, where it breaks
Fix tracked by rdar://problem/18682097

Swift SVN r22801
2014-10-16 21:04:51 +00:00
Dave Abrahams
506a1b07a6 [stdlib] Modernize ArrayBuffer uniqueness check
Swift SVN r22773
2014-10-15 21:17:31 +00:00
Dave Abrahams
903459d87e [stdlib] ManagedBuffer updates
Edit comments, add a holdsUniqueReference test, and make the buffer
class validity check work for the empty array buffer class.

Swift SVN r22747
2014-10-15 03:57:56 +00:00
Dmitri Hrybenko
fea5de2fc8 stdlib and runtime: coding style fixes
Swift SVN r22685
2014-10-11 01:40:57 +00:00
Dmitri Hrybenko
8d68624c87 stdlib: fix doc comment syntax and coding style
Swift SVN r22684
2014-10-11 01:33:05 +00:00
Dave Abrahams
5c33278e63 [stdlib] Add ManagedBufferPointer
A revamped version of HeapBuffer that doesn't allow null buffer
references.  Something like this is needed for killing the null array
state.

Swift SVN r22683
2014-10-11 01:10:38 +00:00
Dave Abrahams
74e27aaab1 [stdlib] uniqueness checking for users
Make unique reference checking available to users, making ManagedBuffer
a complete facility for building COW value types.  Also rationalize the
way we name and organize the runtime primitives we ultimately call.

Swift SVN r22594
2014-10-08 04:48:52 +00:00
Dave Abrahams
83eec23968 [stdlib] Revert "Gyb ManagedBuffer..."
This reverts r22541.  It turns out that because of the type-punning we
need in order to handle the canonical empty array buffer in Array<Int>
and Array<SomeClass>, calls through methods that could be
dynamically-dispatched (i.e. methods of classes) can't be used to access
an array buffer.  So, for arrays, we need to keep the HeapBuffer
strategy wherein a struct manager object does all the address
calculations.

ManagedBuffer is still a useful tool for users though, and it fills the
role that HeapBuffer was intended to serve for them better than
HeapBuffer itself does, because it is simpler and more type-safe.

Swift SVN r22573
2014-10-07 21:40:43 +00:00
Dave Abrahams
01f6f811b5 [stdlib] Gyb ManagedBuffer for Array storage
Swift SVN r22541
2014-10-06 18:40:04 +00:00
Dave Abrahams
c0f4b11b95 [stdlib] Don't expose uninitialized memory
...at least, not without the word "unsafe."  ManagedBuffer's create()
function takes a closure that creates an initial value for its "value"
property (which is technically computed but effectively stored).  Before
this change, the closure had access to that property before it was
initialized.  Now you can still get there, but you have to go through
"withUnsafeMutablePointer*" methods.

Swift SVN r22501
2014-10-03 21:30:00 +00:00
Dave Abrahams
65ec2cdb00 [stdlib] Minor ManagedBuffer cleanups
In preparation for gyb'ing; we'll need to inject different base classes
so we can use this for Array et. al.

Swift SVN r22500
2014-10-03 21:29:59 +00:00
Dave Abrahams
43deddf8ac [stdlib] Move ManagedBuffer prototype into stdlib
...in preparation to use it in _[Contiguous]ArrayBuffer

Swift SVN r22440
2014-10-01 21:12:43 +00:00