Page MenuHomePhabricator

evas_textblock: enhance escape character handling
Needs ReviewPublic

Authored by ali.alzyod on Jul 22 2019, 3:21 AM.

Details

Summary

-Lazy initialization for html escapes lists
-Lower memory consumtion for escapes lists
-Simplify code maintenance by sorting lists on runtime, new items donot need to respect sort order(run time will handle it)

Diff Detail

Repository
rEFL core/efl
Branch
arcpatch-D9370
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13092
Build 9312: arc lint + arc unit
ali.alzyod created this revision.Jul 22 2019, 3:21 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

ali.alzyod requested review of this revision.Jul 22 2019, 3:21 AM
cedric requested changes to this revision.Jul 29 2019, 11:35 AM
cedric added inline comments.
src/lib/evas/canvas/evas_object_textblock.c
1294–1300

I am not a big fan of this function. I would prefer to have one level more of indirection that does all the logic of the len, source and compare function then call the function that just does the allocation and sort. All the caller will use the specific function without having to specify an enum.

1306

Why not memcpy?

1317

Same as above. I think split function would be nicer here too. So same coment as for the previous function.

7824–7825

Weird space character.

This revision now requires changes to proceed.Jul 29 2019, 11:35 AM
ali.alzyod added inline comments.Jul 29 2019, 12:51 PM
src/lib/evas/canvas/evas_object_textblock.c
1294–1300

I think I made mistake by not adding comment to this function

1306

because I am not copying buffer to buffer but instead addresses of struct of one buffer to other buffer.

I use this technique to save memory.

The idea that i have struct contain (escape_string, escape_value,escape_string_len,escape_value_len).
And I need two copy of array of these struct.
So first I create array with all struct element, then create two arrays that have addresses for each element of first array, the sort addrress in both arrays, by doing this I am saving alot of memory

1317

I should add comment to this function, sorry

ali.alzyod updated this revision to Diff 24473.Sun, Aug 25, 9:31 AM

remove space

ali.alzyod marked an inline comment as done.

remove enum, and flat function call

ali.alzyod marked 2 inline comments as done.Sun, Aug 25, 10:12 AM
ali.alzyod updated this revision to Diff 24703.Tue, Sep 3, 4:27 AM

code convention