On Tue, 17 May 2022 06:18:25 GMT, Ioi Lam <ik...@openjdk.org> wrote: >> Severin Gehwolf has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use stringStream to simplify controller path assembly > > src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 92: > >> 90: } >> 91: ss.print_raw(_root, last_matching_slash_pos); >> 92: _path = os::strdup(ss.base()); > > Do you mean `Find the longest common prefix`? Maybe give an example in the > comments? Text parsing in C code is really difficult to understand.
Maybe factor out the search like this // Return length of common starting substring. E.g. "cat" for ("cattle", "catnip"); static int find_common_starting_substring(const char* s1, const char* s2) { ... } That way its clearer and we can find and move this to utilities if we ever need this in other places. ------------- PR: https://git.openjdk.java.net/jdk/pull/8629