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

Reply via email to