Allocation / growable-append calls: repeated inside a loop is the classic accidental reallocation / string-concat O(n^2). Names are deliberately conservative; meaningless in some languages → simply never matches there.
| 1079 | // accidental reallocation / string-concat O(n^2). Names are deliberately |
| 1080 | // conservative; meaningless in some languages → simply never matches there. |
| 1081 | static bool is_alloc_name(const char *n) { |
| 1082 | static const char *const set[] = {"malloc", "calloc", "realloc", "strdup", "strndup", |
| 1083 | "append", "push_back", "emplace_back", "concat", "strcat", |
| 1084 | "strncat", "push", "pushback", NULL}; |
| 1085 | return name_in_set(n, set); |
| 1086 | } |
| 1087 | |
| 1088 | // Extract the receiver identifier from a def's receiver text — Go's |
| 1089 | // "(s *Store)" / "(s Store)" → "s". Stores the identifier start in *out and |
no test coverage detected