apparent_cwd(Util::get_apparent_cwd(actual_cwd))
{
}
-
-Context::~Context()
-{
- free(result_name);
-}
#include "ccache.hpp"
#include "hash.hpp"
+#include "third_party/nonstd/optional.hpp"
+
#include <string>
#include <unordered_map>
#include <vector>
struct Context : NonCopyable
{
Context();
- ~Context();
ArgsInfo args_info;
Config config;
// Name (represented as a struct digest) of the file containing the cached
// result.
- struct digest* result_name = nullptr;
+ nonstd::optional<struct digest> result_name;
// Full path to the file containing the result
// (cachedir/a/b/cdef[...]-size.result).
{
char result_name_string[DIGEST_STRING_BUFFER_SIZE];
digest_as_string(result_name, result_name_string);
- ctx.result_name = result_name;
+ ctx.result_name = *result_name;
ctx.result_path = Util::get_path_in_cache(ctx.config.cache_dir(),
ctx.config.cache_dir_levels(),
result_name_string,