aboutsummaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-04-12 00:04:19 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-11-07 22:21:54 +0000
commitb2ab2241f20fd3da11c92f8edde4639ab8ce996f (patch)
treee63448424695f4f195b55791687cdaec9d831011 /src/helper
parent8b1ee1b1f6d41a0f7d588b128a22e8d5abeb85a7 (diff)
downloadriscv-openocd-b2ab2241f20fd3da11c92f8edde4639ab8ce996f.zip
riscv-openocd-b2ab2241f20fd3da11c92f8edde4639ab8ce996f.tar.gz
riscv-openocd-b2ab2241f20fd3da11c92f8edde4639ab8ce996f.tar.bz2
jimtcl: revert temporary workaround for memory leak in jimtcl 0.80
By using jimtcl from latest master branch, the workaround added in commit 36ae487ed04b ("jimtcl: add temporary workaround for memory leak in jimtcl 0.80") is not needed anymore. Revert the workaround. Change-Id: Ia1b5804be15362d0400740c375455ee19ac09f04 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6228 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/command.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index 7c29f73..53ee250 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -137,41 +137,6 @@ static void command_log_capture_finish(struct log_capture_state *state)
free(state);
}
-/*
- * FIXME: workaround for memory leak in jimtcl 0.80
- * Jim API Jim_CreateCommand() converts the command name in a Jim object and
- * does not free the object. Fixed for jimtcl 0.81 by e4416cf86f0b
- * Use the internal jimtcl API Jim_CreateCommandObj, not exported by jim.h,
- * and override the bugged API through preprocessor's macro.
- * This workaround works only when jimtcl is compiled as OpenOCD submodule.
- * It's broken on macOS, so it's currently restricted on Linux only.
- * If jimtcl is linked-in from a precompiled library, either static or dynamic,
- * the symbol Jim_CreateCommandObj is not exported and the build will use the
- * bugged API.
- * To be removed when OpenOCD will switch to jimtcl 0.81
- */
-#if JIM_VERSION == 80 && defined __linux__
-static int workaround_createcommand(Jim_Interp *interp, const char *cmdName,
- Jim_CmdProc *cmdProc, void *privData, Jim_DelCmdProc *delProc);
-int Jim_CreateCommandObj(Jim_Interp *interp, Jim_Obj *cmdNameObj,
- Jim_CmdProc *cmdProc, void *privData, Jim_DelCmdProc *delProc)
-__attribute__((weak, alias("workaround_createcommand")));
-static int workaround_createcommand(Jim_Interp *interp, const char *cmdName,
- Jim_CmdProc *cmdProc, void *privData, Jim_DelCmdProc *delProc)
-{
- if ((void *)Jim_CreateCommandObj == (void *)workaround_createcommand)
- return Jim_CreateCommand(interp, cmdName, cmdProc, privData, delProc);
-
- Jim_Obj *cmd_name = Jim_NewStringObj(interp, cmdName, -1);
- Jim_IncrRefCount(cmd_name);
- int retval = Jim_CreateCommandObj(interp, cmd_name, cmdProc, privData, delProc);
- Jim_DecrRefCount(interp, cmd_name);
- return retval;
-}
-#define Jim_CreateCommand workaround_createcommand
-#endif /* JIM_VERSION == 80 && defined __linux__*/
-/* FIXME: end of workaround for memory leak in jimtcl 0.80 */
-
static int command_retval_set(Jim_Interp *interp, int retval)
{
int *return_retval = Jim_GetAssocData(interp, "retval");