From 579f63616a92c0d97eb868d6f5b94e68be74b185 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 15 Sep 2008 16:41:37 +0000 Subject: Make MemoryRegion members non-mutable, change const decls --- include/secmem.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include/secmem.h') diff --git a/include/secmem.h b/include/secmem.h index 1835d5bf6..37adf7f42 100644 --- a/include/secmem.h +++ b/include/secmem.h @@ -61,7 +61,7 @@ class MemoryRegion void destroy() { create(0); } void create(u32bit); - void grow_to(u32bit) const; + void grow_to(u32bit); void swap(MemoryRegion&); ~MemoryRegion() { deallocate(buf, allocated); } @@ -78,18 +78,18 @@ class MemoryRegion void init(bool locking, u32bit length = 0) { alloc = Allocator::get(locking); create(length); } private: - T* allocate(u32bit n) const + T* allocate(u32bit n) { return static_cast(alloc->allocate(sizeof(T)*n)); } - void deallocate(T* p, u32bit n) const + void deallocate(T* p, u32bit n) { alloc->deallocate(p, sizeof(T)*n); } - mutable T* buf; - mutable u32bit used; - mutable u32bit allocated; - mutable Allocator* alloc; + T* buf; + u32bit used; + u32bit allocated; + Allocator* alloc; }; /************************************************* @@ -108,7 +108,7 @@ void MemoryRegion::create(u32bit n) * Increase the size of the buffer * *************************************************/ template -void MemoryRegion::grow_to(u32bit n) const +void MemoryRegion::grow_to(u32bit n) { if(n > used && n <= allocated) { -- cgit v1.2.3