OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
|
#include <unistd.h>
#include <fcntl.h>
#include <cstddef>
#include <libguile.h>
#include <libguile/backtrace.h>
#include <libguile/debug.h>
#include <libguile/lang.h>
#include <pthread.h>
#include <opencog/util/Logger.h>
#include <opencog/util/oc_assert.h>
#include <opencog/util/platform.h>
#include <opencog/atomspace/TruthValue.h>
#include "SchemeEval.h"
#include "SchemePrimitive.h"
#include "SchemeSmob.h"
Go to the source code of this file.
Macros | |
#define | WORK_AROUND_GUILE_185_BUG |
#define | WORK_AROUND_GUILE_THREADING_BUG |
#define | BUFSZ 1000 |
Functions | |
static void * | do_bogus_scm (void *p) |
static void | init_only_once (void) |
static void | do_gc (void) |
SCM | recast_scm_eval_string (void *expr) |
static SCM | thunk_scm_eval (void *expr) |
static SchemeEval * | get_from_pool (void) |
static void | return_to_pool (SchemeEval *ev) |
Variables | |
std::mutex | init_mtx |
static std::atomic_flag | eval_is_inited = ATOMIC_FLAG_INIT |
static thread_local bool | thread_is_inited = false |
static SCM | guile_user_module |
static pthread_mutex_t | serialize_lock |
static pthread_key_t | ser_key = 0 |
static concurrent_stack < SchemeEval * > | pool |
static std::mutex | pool_mtx |
#define BUFSZ 1000 |
#define WORK_AROUND_GUILE_185_BUG |
Definition at line 208 of file SchemeEval.cc.
#define WORK_AROUND_GUILE_THREADING_BUG |
Definition at line 230 of file SchemeEval.cc.
|
static |
|
static |
Ad hoc hack to try to limit guile memory consumption, while still providing decent performance. The problem addressed here is that guile can get piggy with the system RAM, happily gobbling up RAM instead of garbage-collecting it. Users have noticed. See github issue #1116. This improves on the original pull request #1117. Clue: bug report #1419 suggests the problem is related to the do_async_output flag– setting it to false avoids the blow-up. Is there an i/o-related leak or weird reserve bug?
Definition at line 551 of file SchemeEval.cc.
|
static |
Definition at line 1108 of file SchemeEval.cc.
References pool, and pool_mtx.
|
static |
Definition at line 260 of file SchemeEval.cc.
References do_bogus_scm(), eval_is_inited, guile_user_module, ser_key, and serialize_lock.
SCM recast_scm_eval_string | ( | void * | expr | ) |
|
static |
Definition at line 1116 of file SchemeEval.cc.
References pool, and pool_mtx.
|
static |
|
static |
Definition at line 204 of file SchemeEval.cc.
|
static |
Definition at line 220 of file SchemeEval.cc.
std::mutex init_mtx |
Definition at line 35 of file SchemeEval.cc.
|
static |
Definition at line 1105 of file SchemeEval.cc.
|
static |
Definition at line 1106 of file SchemeEval.cc.
|
static |
Definition at line 255 of file SchemeEval.cc.
|
static |
Definition at line 254 of file SchemeEval.cc.
|
static |
Definition at line 205 of file SchemeEval.cc.