diff --git a/repos/base/include/base/allocator_avl.h b/repos/base/include/base/allocator_avl.h index b32cb84a2..0dd6e1ac5 100644 --- a/repos/base/include/base/allocator_avl.h +++ b/repos/base/include/base/allocator_avl.h @@ -94,19 +94,24 @@ class Genode::Allocator_avl_base : public Range_allocator */ void recompute(); - /** - * Accessor functions - */ - inline int id() { return _id; } - inline addr_t addr() { return _addr; } - inline size_t avail() { return _used ? 0 : _size; } - inline size_t size() { return _size; } - inline bool used() { return _used; } - inline size_t max_avail() { return _max_avail; } - inline void used(bool used) { _used = used; } + + /***************** + ** Accessorors ** + *****************/ + + inline int id() const { return _id; } + inline addr_t addr() const { return _addr; } + inline size_t avail() const { return _used ? 0 : _size; } + inline size_t size() const { return _size; } + inline bool used() const { return _used; } + inline size_t max_avail() const { return _max_avail; } + + inline void used(bool used) { _used = used; } + enum { FREE = false, USED = true }; + /** * Constructor * diff --git a/repos/base/include/base/slab.h b/repos/base/include/base/slab.h index b00a35d26..c42126b32 100644 --- a/repos/base/include/base/slab.h +++ b/repos/base/include/base/slab.h @@ -94,7 +94,7 @@ class Genode::Slab_block /** * Request number of available entries in block */ - unsigned avail() { return _avail; } + unsigned avail() const { return _avail; } /** * Allocate slab entry from block @@ -182,10 +182,10 @@ class Genode::Slab : public Allocator public: - inline size_t slab_size() { return _slab_size; } - inline size_t block_size() { return _block_size; } - inline size_t num_elem() { return _num_elem; } - inline size_t entry_size() { return sizeof(Slab_entry) + _slab_size; } + inline size_t slab_size() const { return _slab_size; } + inline size_t block_size() const { return _block_size; } + inline size_t num_elem() const { return _num_elem; } + inline size_t entry_size() const { return sizeof(Slab_entry) + _slab_size; } /** * Constructor