pike.git/
src/
program.c
Branch:
Tag:
Non-build tags
All tags
No tags
2018-12-17
2018-12-17 13:41:32 by Henrik Grubbström (Grubba) <grubba@grubba.org>
b2dc9588ef3817c807aefe0f4905814ae995a43b (
19
lines) (+
10
/-
9
)
[
Show
|
Annotate
]
Branch:
master
Compiler: Use multisets for annotations on identifiers.
3554:
if (p->annotations) { for (e = 0; e < p->num_annotations; e++) {
-
do_free_
array
(p->annotations[e]);
+
do_free_
multiset
(p->annotations[e]);
} }
4314:
if (val) { if (Pike_compiler->new_program->annotations[id]) {
-
Pike
_
compiler->new_program->annotations[id] =
-
append_array
(Pike_compiler->new_program->annotations[id], val);
+
multiset
_
add
(Pike_compiler->new_program->annotations[id], val);
} else { push_svalue(val);
-
Pike_compiler->new_program->annotations[id] =
aggregate
_
array(
1
)
;
+
f_aggregate_multiset(1);
+
Pike_compiler->new_program->annotations[id] =
Pike
_
sp[-
1
].u.multiset
;
+
Pike_sp--;
} } }
7991:
} if ((p2->num_annotations > ref->identifier_offset) && p2->annotations[ref->identifier_offset]) {
-
ref_push_
array
(p2->annotations[ref->identifier_offset]);
-
f_mkmultiset(1);
+
ref_push_
multiset
(p2->annotations[ref->identifier_offset]);
if (inh_ann) { f_add(2); }
9036:
for (e = p->num_annotations-1; e >= 0; e--) { if (p->annotations[e])
-
gc_mark_
array
_as_referenced(p->annotations[e]);
+
gc_mark_
multiset
_as_referenced(p->annotations[e]);
} } GC_LEAVE; }
9065:
for (e = p->num_annotations - 1; e >= 0; e--) { if (p->annotations[e])
-
gc_cycle_check_
array
(p->annotations[e], 0);
+
gc_cycle_check_
multiset
(p->annotations[e], 0);
} /* Strong ref follows. It must be last. */
9240:
} for (e = 0; e < p->num_annotations; e++) {
-
do_free_
array
(p->annotations[e]);
+
do_free_
multiset
(p->annotations[e]);
p->annotations[e] = NULL; }