jimtcl: revert temporary workaround for memory leak in jimtcl 0.80
[openocd.git] / src / helper / command.c
index 7c29f73e6e5bccde4d3d1b606341c29b393dba74..53ee2508a98982aa5d5dc5e51ee3fb67e284f0a4 100644 (file)
@@ -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");

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)