mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This flag makes ASTContext and SILModule's allocators go through malloc instead of using bump pointer allocators, so that GuardMalloc or similar tools can be used to look for memory bugs. Swift SVN r5472
20 lines
645 B
Bash
Executable File
20 lines
645 B
Bash
Executable File
#!/bin/sh
|
|
# Runs swift (found on the path) with -use-malloc and GuardMalloc enabled.
|
|
# Command-line arguments are forwarded to the Swift compiler untouched.
|
|
# This script can be used to run the test suite with memory debugging enabled
|
|
# by setting the SWIFT environment variable to point to the script, as in:
|
|
#
|
|
# SWIFT=/path/to/guard-malloc-swift llvm-lit -sv test
|
|
|
|
export MallocScribble=1
|
|
export MallocPreScribble=1
|
|
export MallocGuardEdges=1
|
|
export MallocCheckHeapStart=100
|
|
export MallocCheckHeapEach=100
|
|
export MallocCheckHeapAbort=1
|
|
export MallocErrorAbort=1
|
|
|
|
export DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib
|
|
|
|
swift -use-malloc "$@"
|