Fix hexdump bottleneck issue and probably a segfault too

This commit is contained in:
pancake 2018-07-08 02:08:45 +02:00 committed by radare
parent 3e5bcd4cc7
commit 16c807f1ce
2 changed files with 3 additions and 1 deletions

View File

@ -986,6 +986,7 @@ R_API void r_cons_newline() {
}
/* return the aproximated x,y of cursor before flushing */
// XXX this function is a huge bottleneck
R_API int r_cons_get_cursor(int *rows) {
int i, col = 0;
int row = 0;

View File

@ -876,8 +876,9 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba
if (p) {
p->interrupt = 0;
}
// is this necessary?
r_print_set_screenbounds (p, addr);
for (i = j = 0; i < len; i += (stride? stride: inc), j += (stride? stride: 0)) {
r_print_set_screenbounds (p, addr + i);
if (p && p->cons && p->cons->context && p->cons->context->breaked) {
break;
}