Improve memory allocation APIs
- replace `qe_malloc_dup()` with `qe_malloc_dup_bytes()` and `qe_malloc_dup_array()` - replace `qe_realloc()` with `qe_realloc_bytes()` and `qe_realloc_array()` - pass numbers of objects to `qe_malloc_dup_array` and `qe_realloc_array` - add `qe_strndup()`
This commit is contained in:
parent
0935cb4894
commit
494ea38c33
12 changed files with 136 additions and 45 deletions
|
|
@ -1077,7 +1077,7 @@ void css_parse_style_sheet(CSSStyleSheet *s, CSSParseState *b)
|
|||
if (qe_isalpha(ch)) {
|
||||
tree_op = CSS_TREE_OP_DESCENDANT;
|
||||
add_tree:
|
||||
ss1 = qe_malloc_dup(ss, sizeof(CSSSimpleSelector));
|
||||
ss1 = qe_malloc_dup_array(ss, 1);
|
||||
if (ss1) {
|
||||
last_ss = ss1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue