I am out sick after JVMLS, typical post conference flu. There is no need to rush this, right?
I really dislike MemType for its very genericness. MEMFLAGS is a handle into the NMT subsystem. It has no meaning beyond NMT. Yet, it is spread all over the code base. Therefore I really would like an NMT prefix, whatever the name then is. Clear and easy to grep. A very generic name like MemType or similar will clash with many similar sounding specifiers from other places. That may not sound so much of an issue if you are only working within a single hotspot subsystem; but if you work in all corners of the JDK, you come to like clear succinct names, and an important part of clearness is scope, and the scope here is NMT. Just my 5 cent On Wed 14. Aug 2024 at 17:43, Gerard Ziemski <gziem...@openjdk.org> wrote: > On Wed, 14 Aug 2024 06:54:22 GMT, Stefan Karlsson <stef...@openjdk.org> > wrote: > > > > Is everyone OK with MemTypeFlag? > > > > It's quite unfortunate to have a three-word type for something this > prolific in our code base. Why not go with `MemType` and change variable > names from `flag` to `mt`? > > > > ``` > > static char* map_memory_to_file(size_t size, int fd, MEMFLAGS flag = > mtNone); > > ``` > > > > would then become: > > > > ``` > > static char* map_memory_to_file(size_t size, int fd, MemType mt = > mtNone); > > ``` > > My initial choice was exactly that, but then I backed-off from renaming > the arguments, because how big and intrusive the change it seemed. > > David seems to prefer `MemTypeFlag`, so that we don't have to rename all > the arguments and I see a point in that, but it wouldn't be my first choice. > > Thomas seems to prefer `NMTCat` that I just don't like much, despite that > it has NMT prefix in it, for some reason. > > If we could find a compromise that we all can live with, despite it not > being exactly what every single person wants, then that would be great. We > could this in separate steps: > > Initial effort (this fix): we rename `MEMFLAGS` to `MemType` > > Follow up effort(s): we either rename all arguments in one big push > (intrusive) or we do it a file, or related files (like NMT) together at a > time in a followup(s) or whenever we are in the file with some related fix. > Eventually we would get there, which is better than what we have right now > IMHO. > > Is this a reasonable compromise to everyone? > > ------------- > > PR Comment: https://git.openjdk.org/jdk/pull/20497#issuecomment-2289134648 >