Revision ad78f9a3d96278ed65ecc4da4f7f6f316dda2b80 authored by Trent Nadeau on 22 January 2016, 21:57:46 UTC, committed by Trent Nadeau on 24 January 2016, 18:38:03 UTC
1 parent 32ea32b
Raw File
guard-malloc-swift
#!/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 "$@"
back to top