[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
347/376: Remove canary stuff
From: |
Ludovic Courtès |
Subject: |
347/376: Remove canary stuff |
Date: |
Wed, 28 Jan 2015 22:06:05 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit 8aedaf111eff8be53361b2e3cfa43a86a0c9ec2d
Author: Eelco Dolstra <address@hidden>
Date: Fri Dec 12 10:59:50 2014 +0100
Remove canary stuff
---
src/libexpr/eval.cc | 21 ---------------------
src/libexpr/eval.hh | 8 --------
src/libexpr/primops.cc | 27 ---------------------------
src/nix-instantiate/nix-instantiate.cc | 2 --
4 files changed, 0 insertions(+), 58 deletions(-)
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 2ff9756..298f6a3 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -247,7 +247,6 @@ EvalState::EvalState(const Strings & _searchPath)
EvalState::~EvalState()
{
fileEvalCache.clear();
- printCanaries();
}
@@ -1514,26 +1513,6 @@ void EvalState::printStats()
}
-void EvalState::printCanaries()
-{
-#if HAVE_BOEHMGC
- if (!settings.get("debug-gc", false)) return;
-
- GC_gcollect();
-
- if (gcCanaries.empty()) {
- printMsg(lvlError, "all canaries have been garbage-collected");
- return;
- }
-
- printMsg(lvlError, "the following canaries have not been
garbage-collected:");
-
- for (auto i : gcCanaries)
- printMsg(lvlError, format(" %1%") % i->string.s);
-#endif
-}
-
-
size_t valueSize(Value & v)
{
std::set<const void *> seen;
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 8bf65c2..7894292 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -287,8 +287,6 @@ public:
/* Print statistics. */
void printStats();
- void printCanaries();
-
private:
unsigned long nrEnvs;
@@ -320,12 +318,6 @@ private:
friend struct ExprOpConcatLists;
friend struct ExprSelect;
friend void prim_getAttr(EvalState & state, const Pos & pos, Value * *
args, Value & v);
-
-#if HAVE_BOEHMGC
- std::set<Value *> gcCanaries;
- friend void canaryFinalizer(GC_PTR obj, GC_PTR client_data);
- friend void prim_gcCanary(EvalState & state, const Pos & pos, Value * *
args, Value & v);
-#endif
};
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 1ddeac6..cd7b287 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -417,32 +417,6 @@ static void prim_trace(EvalState & state, const Pos & pos,
Value * * args, Value
}
-#if HAVE_BOEHMGC
-void canaryFinalizer(GC_PTR obj, GC_PTR client_data)
-{
- Value * v = (Value *) obj;
- EvalState & state(* (EvalState *) client_data);
- printMsg(lvlError, format("canary ‘%1%’ garbage-collected") % v->string.s);
- auto i = state.gcCanaries.find(v);
- assert(i != state.gcCanaries.end());
- state.gcCanaries.erase(i);
-}
-#endif
-
-
-void prim_gcCanary(EvalState & state, const Pos & pos, Value * * args, Value &
v)
-{
- string s = state.forceStringNoCtx(*args[0], pos);
- state.mkList(v, 1);
- Value * canary = v.list.elems[0] = state.allocValue();
-#if HAVE_BOEHMGC
- state.gcCanaries.insert(canary);
- GC_register_finalizer(canary, canaryFinalizer, &state, 0, 0);
-#endif
- mkString(*canary, s);
-}
-
-
void prim_valueSize(EvalState & state, const Pos & pos, Value * * args, Value
& v)
{
/* We're not forcing the argument on purpose. */
@@ -1560,7 +1534,6 @@ void EvalState::createBaseEnv()
// Debugging
addPrimOp("__trace", 2, prim_trace);
- addPrimOp("__gcCanary", 1, prim_gcCanary);
addPrimOp("__valueSize", 1, prim_valueSize);
// Paths
diff --git a/src/nix-instantiate/nix-instantiate.cc
b/src/nix-instantiate/nix-instantiate.cc
index 9a6e178..e7214e6 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -86,8 +86,6 @@ void processExpr(EvalState & state, const Strings & attrPaths,
}
}
}
-
- state.printCanaries();
}
- 334/376: Update signing.txt, (continued)
- 334/376: Update signing.txt, Ludovic Courtès, 2015/01/28
- 336/376: Cruft, Ludovic Courtès, 2015/01/28
- 339/376: Include cacert in the binary tarball, Ludovic Courtès, 2015/01/28
- 340/376: Rename function, Ludovic Courtès, 2015/01/28
- 342/376: Don't do vfork in conjunction with setuid, Ludovic Courtès, 2015/01/28
- 341/376: Use vfork, Ludovic Courtès, 2015/01/28
- 345/376: allow custom docbook paths/URLs, use a working URL for docbook.rng, Ludovic Courtès, 2015/01/28
- 344/376: Urgh, Ludovic Courtès, 2015/01/28
- 343/376: Provide default pagers, Ludovic Courtès, 2015/01/28
- 346/376: Don't use ?=, Ludovic Courtès, 2015/01/28
- 347/376: Remove canary stuff,
Ludovic Courtès <=
- 348/376: Remove dead code, Ludovic Courtès, 2015/01/28
- 350/376: Doh, Ludovic Courtès, 2015/01/28
- 338/376: Don't wait for PID -1, Ludovic Courtès, 2015/01/28
- 352/376: Get rid of unnecessary "interrupted by the user" message with -vvv, Ludovic Courtès, 2015/01/28
- 353/376: Don't abort if we get a signal while waiting for the pager, Ludovic Courtès, 2015/01/28
- 351/376: Remove chatty message, Ludovic Courtès, 2015/01/28
- 356/376: Shut up a Valgrind warning, Ludovic Courtès, 2015/01/28
- 349/376: Remove tabs, Ludovic Courtès, 2015/01/28
- 355/376: Fix some memory leaks, Ludovic Courtès, 2015/01/28
- 357/376: Silence some warnings on GCC 4.9, Ludovic Courtès, 2015/01/28