@@ -14,28 +14,56 @@ namespace data {
1414class zone {
1515public:
1616 class info {
17- private:
18- constexpr static uint32_t zone_id_mask = 0x7fffffff ;
19- uint32_t _value;
20- constexpr info (uint32_t value) : _value(value){};
21-
2217 public:
23- uint32_t zone_id () { return _value & zone_id_mask; };
24- info with_zone_id (uint32_t zone_id) const { return info ((_value & ~zone_id_mask) | (zone_id & zone_id_mask)); };
18+ OG_INLINE OG_CONSTEXPR
19+ info () OG_NOEXCEPT : _value(0 ) {};
20+
21+ OG_INLINE OG_CONSTEXPR
22+ info (uint32_t value) OG_NOEXCEPT : _value(value){};
23+
24+ OG_INLINE OG_CONSTEXPR
25+ info (uint32_t zone_id, bool deleted) OG_NOEXCEPT : _value((zone_id & zone_id_mask) | (deleted ? 1 : 0 )) {};
26+
27+ OG_INLINE OG_CONSTEXPR
28+ uint32_t value () const OG_NOEXCEPT { return _value; };
29+
30+ OG_INLINE OG_CONSTEXPR
31+ uint32_t zone_id () const OG_NOEXCEPT { return _value & zone_id_mask; };
32+
33+ OG_INLINE OG_CONSTEXPR
34+ bool is_deleted () const OG_NOEXCEPT { return (_value & deleted) != 0 ; };
2535
26- uint32_t to_raw_value () { return _value; };
27- static info from_raw_value (uint32_t value) { return info (value); };
36+ OG_INLINE OG_CONSTEXPR
37+ info with_zone_id (uint32_t zone_id) const OG_NOEXCEPT {
38+ return info ((_value & ~zone_id_mask) | (zone_id & zone_id_mask), is_deleted ());
39+ };
40+
41+ OG_INLINE OG_CONSTEXPR
42+ info with_deleted (bool deleted) const OG_NOEXCEPT {
43+ return info (zone_id (), deleted);
44+ }
45+ private:
46+ enum {
47+ zone_id_mask = 0x7fffffff ,
48+ deleted = 0x80000000 ,
49+ };
50+ uint32_t _value;
2851 }; /* info */
2952public:
30- zone ();
53+ // zone() OG_NOEXCEPT = default;
54+ // ~zone() OG_NOEXCEPT;
55+
56+ OG_INLINE OG_CONSTEXPR
57+ auto & malloc_buffers () const OG_NOEXCEPT { return _malloc_buffers; };
3158
3259 OG_INLINE OG_CONSTEXPR
3360 ptr<page> last_page () const OG_NOEXCEPT { return _last_page; };
3461
3562 OG_INLINE OG_CONSTEXPR
3663 info info () const OG_NOEXCEPT { return _info; };
3764
38- void clear () OG_NOEXCEPT;
65+ OG_INLINE
66+ void clear ();
3967
4068 ptr<void > alloc_slow (uint32_t size, uint32_t alignment_mask) OG_NOEXCEPT;
4169
@@ -49,15 +77,12 @@ class zone {
4977 // Printing
5078 void print () const OG_NOEXCEPT;
5179
52- void print_header () OG_NOEXCEPT;
53-
54- ~zone ();
80+ void print_header () const OG_NOEXCEPT;
5581private:
5682 typedef struct _bytes_info {
5783 ptr<struct _bytes_info > next;
5884 uint32_t size;
5985 } bytes_info;
60-
6186 vector<std::unique_ptr<void , table::malloc_zone_deleter>, 0 , uint32_t > _malloc_buffers;
6287 ptr<page> _last_page;
6388 ptr<bytes_info> _free_bytes;
0 commit comments