Commit Graph

45 Commits

Author SHA1 Message Date
Dave Zarzycki
06731bbe21 Heap feedback: rename _swift_zone_init_ to _swift_zone_initImpl
Swift SVN r17729
2014-05-08 23:20:49 +00:00
Dave Zarzycki
8b0c9d4e74 Heap: Let Instruments ensure that the heap is setup correctly at launch
Swift SVN r17723
2014-05-08 23:12:57 +00:00
Dave Zarzycki
1326006ed8 Runtime heap/introspection: Instruments team feedback
Swift SVN r17274
2014-05-02 21:41:16 +00:00
Dave Zarzycki
1930222f3b Runtime: Instruments support plan B
Rather than go through reentrant and problematic contortions to make Swift
work with the existing Instruments hooks, they agreed to just patch some
globals that we provide to get their logic to be activated.

Swift SVN r17144
2014-05-01 06:39:45 +00:00
Dave Zarzycki
fcd4667f08 Runtime heap: add some missing locking
Swift SVN r17104
2014-04-30 19:29:56 +00:00
Dave Zarzycki
ff84cce42b Runtime: conditional fallback to pthreads given we don't ship with the OS
<rdar://problem/15169581> Custom allocation cache cannot assume OS implementation details for 1.0

Swift SVN r16842
2014-04-25 20:57:03 +00:00
Dave Zarzycki
211afa943f Runtime: better crash debugging/reporting
Swift SVN r16426
2014-04-16 21:37:16 +00:00
Dave Zarzycki
3e4f388b1f Runtime: allow realloc
Nothing should call this. We'll eventually log a warning. For now, this
silences a build warning.

Swift SVN r16061
2014-04-08 17:54:01 +00:00
Dave Zarzycki
2e76e91466 Runtime: corner case heap policy tweak
Only the compiler calls this API and the compiler never needs
placeholder heap allocations.

Swift SVN r16060
2014-04-08 17:54:00 +00:00
Adrian Prantl
af7198811c silence warnings.
Swift SVN r15839
2014-04-02 22:54:34 +00:00
Dave Zarzycki
4c97c67a82 Runtime: remove stray debugging hook
Swift SVN r15819
2014-04-02 18:46:02 +00:00
Dave Zarzycki
96d1f4760e Runtime heap: mixed fixes that make debugging easier
Swift SVN r15818
2014-04-02 18:46:00 +00:00
Dave Zarzycki
e1a60eae86 Runtime: Use 'auto' more. NFC.
Swift SVN r15817
2014-04-02 18:45:59 +00:00
Dave Zarzycki
0e8de87f05 Runtime: more SwiftObject API completeness
Swift SVN r15696
2014-03-31 22:50:19 +00:00
Dave Zarzycki
09f2e9ed57 WIP Runtime: Zone cleanup to use C++ more. NFC.
All of the malloc zone APIs are clumsy object-oriented design in C, but that
does not mean we should be too. This should clarify the design more too.

Swift SVN r15690
2014-03-31 20:06:16 +00:00
Dave Zarzycki
095633f4ba Runtime: Enable Instruments object lifecycle support
One needs to either set SWIFT_ZONE_DEBUG before launch or call SPI.

Swift SVN r15586
2014-03-28 20:46:40 +00:00
Dave Zarzycki
ce0c5899d8 Runtime: crude enumeration to generate statistics
This is foundational work for 'leaks', etc.

Swift SVN r15490
2014-03-26 06:13:03 +00:00
Dave Zarzycki
c2b486fb91 Runtime: assert on trivial double-free()s
Swift SVN r15336
2014-03-21 21:32:10 +00:00
Dave Zarzycki
c9d5bd8a92 Runtime: fix a leak during thread exit
Swift SVN r15334
2014-03-21 20:59:10 +00:00
Dave Zarzycki
2b412b4626 Runtime: fix a copy-and-paste error
<rdar://problem/16386805> Assertion failed: (bytes != 0), function swift_slowDealloc

Swift SVN r15325
2014-03-21 05:52:04 +00:00
Dave Zarzycki
2cd0940d16 Runtime: make 'vmmap' tool report better data
Swift SVN r15296
2014-03-20 21:02:06 +00:00
Dave Zarzycki
2f4d679fd0 Runtime: Drop the "raw" label on normal memory. NFC.
DI defined away the need for zeroed memory.

Swift SVN r15293
2014-03-20 20:42:27 +00:00
Dave Zarzycki
bd9ce4d42c Runtime: remove dead code
Swift SVN r15291
2014-03-20 20:30:02 +00:00
Dave Zarzycki
6e27d2db1e Runtime: Cleanup constants. NFC.
Swift SVN r15272
2014-03-20 18:20:19 +00:00
Dave Zarzycki
f0777b69b4 Runtime: malloc zone huge allocation support
Swift SVN r15271
2014-03-20 18:20:17 +00:00
Dave Zarzycki
9816e2ab05 Runtime: the Swift heap/zone
Good:
* We now no longer wrap the system malloc zone.
* Tiny allocation quantum is pointer sized, not 16 bytes.
* Far less metadata overhead than the system malloc zone.
Bad:
* Our heap density isn't quite as good as the default zone. This is a O(1)
  versus O(N) tradeoff. The default malloc zone has been trending in this
  direction too.
TODO:
* Introspection
* Tune secondary fast paths
* Huge allocations

Swift SVN r15269
2014-03-20 17:43:56 +00:00
Dave Zarzycki
49bee35d1a Runtime: magic numbers are bad
Swift SVN r15012
2014-03-13 23:15:07 +00:00
Dave Zarzycki
1ef22d5e03 Runtime: make the thread-specific logic work with the public SDK
Swift SVN r15007
2014-03-13 21:32:45 +00:00
Dave Zarzycki
dbd1c1a2bf Runtime: zap dead code
Swift SVN r15005
2014-03-13 21:21:13 +00:00
Dave Zarzycki
cde57afc89 stdlib: do not forward malloc_size()
malloc_size() also is used to determine which zone owns a given allocation.

<rdar://problem/16293435> malloc_size is getting called recursively

Swift SVN r14928
2014-03-11 21:48:14 +00:00
Adrian Prantl
649ce05ff9 silence warnings.
Swift SVN r14534
2014-02-28 20:53:04 +00:00
Dave Zarzycki
46d7fc8a46 Runtime: hardcode less about the OS implementation
This also fixes non-fast-path platforms.

Swift SVN r14481
2014-02-27 22:15:22 +00:00
Doug Gregor
904739cb03 Revert "Runtime: hardcode less about the OS implementation"
This reverts r14453, which seems to be breaking the build.

Swift SVN r14480
2014-02-27 21:43:56 +00:00
Dave Zarzycki
5946a56fa3 Runtime: hardcode less about the OS implementation
There is still more to do in this area before we GM.

Swift SVN r14453
2014-02-27 06:14:53 +00:00
Dave Zarzycki
ab1efa6ec7 runtime: DI means we don't need heap APIs that take/return zero-initialized memory
Swift SVN r14404
2014-02-26 20:31:11 +00:00
Dave Zarzycki
6e1fcdab30 runtime: Make gmalloc work again
<rdar://problem/16165307> Infinite recursion in malloc_zone_malloc when Reflection test is run under guard malloc

Swift SVN r14398
2014-02-26 17:59:27 +00:00
Dave Zarzycki
52ef19fd3e runtime: route more of the heap through the formal zone
Swift SVN r14397
2014-02-26 17:49:54 +00:00
Dave Zarzycki
8fd6b3a4ab runtime: disable the malloc cache entirely for the simulator
Swift SVN r14396
2014-02-26 17:18:31 +00:00
Greg Parker
17628ee626 Disable swift allocation cache pending rdar://16168244.
Swift SVN r14366
2014-02-26 01:37:36 +00:00
Dave Zarzycki
058ab5a6a1 Runtime: Add assert.h
Swift SVN r14259
2014-02-22 14:31:28 +00:00
Doug Gregor
2d08827a8a Fix trivial build issues
Swift SVN r14241
2014-02-21 23:21:11 +00:00
Dave Zarzycki
aebc28f7fe Runtime: silence a harmless warning
Swift SVN r14229
2014-02-21 20:37:22 +00:00
Dave Zarzycki
a85b2a3d78 Runtime: Rename Alloc.* to HeapObject.* (NFC)
Swift SVN r14228
2014-02-21 20:12:07 +00:00
Dave Zarzycki
d0696c60fc Runtime: Move heap logic to Heap.cpp (NFC)
Swift SVN r14227
2014-02-21 20:12:01 +00:00
Dave Zarzycki
b32a02a75f Runtime: wire up wrapper zone around the default zone
Swift SVN r14226
2014-02-21 20:11:48 +00:00