Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feature, strlen are rarely called in jerry-core and jerry-ext, we can remove all the usage of strlen #4979

Open
lygstate opened this issue Feb 9, 2022 · 1 comment · Fixed by #4982 · May be fixed by #5192 or #5198
Open

feature, strlen are rarely called in jerry-core and jerry-ext, we can remove all the usage of strlen #4979

lygstate opened this issue Feb 9, 2022 · 1 comment · Fixed by #4982 · May be fixed by #5192 or #5198
Labels
enhancement An improvement

Comments

@lygstate
Copy link
Contributor

lygstate commented Feb 9, 2022

All the place calling to strlen are

Name	Line	Text	Path
jerry-debugger.c	150	          size_t source_name_size = strlen ((const char *) source_name_p);	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\api
jerryscript.c	5091	                                strlen (str_p));	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\api
jerry-snapshot.c	1472	    string_size = (lit_utf8_size_t) strlen (chars);	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\api
debugger.c	599	        jerry_debugger_send_string (JERRY_DEBUGGER_EVAL_RESULT, type, string_p, strlen ((const char *) string_p));	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\debugger
lit-strings.c	267	  return (lit_utf8_size_t) strlen ((const char *) utf8_str_p);	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-core\lit
module.c	187	    if (module_p->name_p != NULL && strlen ((char *) module_p->name_p) == name_size	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-ext\module
print.c	153	  jerry_size_t buffer_size = (jerry_size_t) (strlen (str_p));	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-ext\util
sources.c	50	    jerry_string ((const jerry_char_t *) path_p, (jerry_size_t) strlen (path_p), JERRY_ENCODING_UTF8);	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-ext\util
sources.c	79	    jerry_string ((const jerry_char_t *) path_p, (jerry_size_t) strlen (path_p), JERRY_ENCODING_UTF8);	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-ext\util
main-snapshot.c	342	    jerry_string ((const jerry_char_t *) file_name_p, (jerry_size_t) strlen (file_name_p), JERRY_ENCODING_UTF8);	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-main
main-snapshot.c	348	                                                (jerry_size_t) strlen (function_args_p),	E:\CI-Cor\acrop\acrop-deps\acrop-jerry\jerryscript\jerry-main

We can improve the usage of strlen by improving the api of jerry-port and other related functions

@LaszloLango
Copy link
Contributor

#4982 did not fix this completely, so I reopened the issue.

@lygstate lygstate linked a pull request Dec 9, 2024 that will close this issue
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
…h_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
…h_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
…h_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
…h_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 11, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 12, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 12, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 12, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 17, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 17, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 17, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 17, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 17, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 17, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 19, 2024
Replace jerry_port_path_normalize,jerry_port_path_free,jerry_port_path_base with jerry_port_path_style,jerry_port_get_cwd

Partially fixes jerryscript-project#4979
Closes: jerryscript-project#4983

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
# for free to join this conversation on GitHub. Already have an account? # to comment