[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-runtime-dev
Subject:    Integrated: 8297534: Specify the size of MEMFLAGS
From:       Johan =?UTF-8?B?U2rDtmxlbg==?= <jsjolen () openjdk ! org>
Date:       2022-11-28 9:33:48
Message-ID: W0plFq2VGDqUNdrgs-wP7j8bwyrE5w2XQIspGGcOpRY=.e1418031-3ef6-4b71-bf68-0bc5e6b6cee6 () github ! com
[Download RAW message or body]

On Wed, 23 Nov 2022 22:19:52 GMT, Johan Sjölen <jsjolen@openjdk.org> wrote:

> Hi!
> 
> In MallocHeader we assume that MEMFLAGS can be stored in a uint8_t, see:
> 
> ```c++
> class MallocHeader {
> 
> NOT_LP64(uint32_t _alt_canary);
> const size_t _size;
> const uint32_t _mst_marker;
> const uint8_t _flags;
> const uint8_t _unused;
> uint16_t _canary;
> // SNIP!
> inline MEMFLAGS flags() const { return (MEMFLAGS)_flags; }
> 
> 
> With C++11 we can specify the underlying type of an `enum class`, so let's just do \
> that. If we generate 257 memflags we'll get a compile error. I don't believe that \
> this would lead to any change in the behavior of the code. 
> Testing: Compiled the code. Running tier1 testing right now.

This pull request has now been integrated.

Changeset: 81eb5fbf
Author:    Johan Sjölen <jsjolen@openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/81eb5fbff516e7470f7cc29a67047a048b525722
                
Stats:     7 lines in 3 files changed: 3 ins; 0 del; 4 mod

8297534: Specify the size of MEMFLAGS

Reviewed-by: stuefe, tschatzl

-------------

PR: https://git.openjdk.org/jdk/pull/11336


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic