If a function exits abnormally, for any reason, the passed in function
frame args would leak. This change captures such early exits and
cleans up the args for directly invoked functions. This clears up about
70% of current memory leaks.
In preparation to clean up the Jam function global stack move the
definition of the STACK and related functions inside the function.cpp
source file only.
Modern memory allocator is fast enough to not need our own
chained caching of specific data. Hence remove the use of caching
of free LIST instances to simplify memory management.
Also remove uses of exit/abort.
This replaces most abort/exit calls with the utility that throws an
exception. The exception is caught in main to cleanly return failure.
This allows to clean up allocations and always return a valid status
value instead of abnormal termination.
This changes the pointer type used everywhere for _targets/TARGETS to a
unique_ptr to manage the ownership correctly. Thus removing the memory
leaks resulting therein.
Similar to 8faba6ab2, don't add double quotes around the RPATH
expansion in clang-linux's link actions, so '$ORIGIN' can be used.
The gcc.quote-rpath rule already checks whether double quotes need to be
added, and skips it if the rpath argument already has single quotes.
If intel exec commands are not detected we try to use the result anyway which would
error. This adds checks that prevent the errors to let the sequence of attempts
work.
fixes#109
Adds rule skip-from-usage-requirements to basic-target, this allows
customizing whether the build of a target should be skipped because one
of its sources has <build>no in usage requirements. So far only one
class takes advantage of this: alias-target-class. As a result alias
targets aren't skipped due to dependencies, but downstream targets still
could.
So, lib <- alias <- exe skips exe if lib is skipped.
But lib <- alias -> lib does not skip alias if either of libs is
skipped.