aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-15 16:41:37 +0000
committerlloyd <[email protected]>2008-09-15 16:41:37 +0000
commit579f63616a92c0d97eb868d6f5b94e68be74b185 (patch)
tree4ca1583b8d44dfcd121cd4bf672c33e77e113abb /include
parent8207944774d2e7f7c378d29f81b20abded0455f3 (diff)
Make MemoryRegion members non-mutable, change const decls
Diffstat (limited to 'include')
-rw-r--r--include/secmem.h16
1 files changed, 8 insertions, 8 deletions
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<T>&);
~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<T*>(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<T>::create(u32bit n)
* Increase the size of the buffer *
*************************************************/
template<typename T>
-void MemoryRegion<T>::grow_to(u32bit n) const
+void MemoryRegion<T>::grow_to(u32bit n)
{
if(n > used && n <= allocated)
{