mirror of
https://git.rtems.org/rtems-tools/
synced 2025-10-18 22:37:51 +08:00
Add region support.
Abstractions for classic/region added.
This commit is contained in:

committed by
Chris Johns

parent
c3d06d531c
commit
b9ee5df588
@@ -15,6 +15,8 @@ class block:
|
||||
return False
|
||||
return True
|
||||
|
||||
def val(self):
|
||||
return str(self.block)
|
||||
|
||||
def next(self):
|
||||
if not self.null():
|
||||
@@ -25,11 +27,15 @@ class block:
|
||||
self.block = self.block['prev']
|
||||
|
||||
class stats:
|
||||
''heap statistics''
|
||||
'''heap statistics'''
|
||||
|
||||
def __init__(self,stat):
|
||||
self.stat = stat
|
||||
|
||||
def inst(self):
|
||||
i = self.stat['instance']
|
||||
return i
|
||||
|
||||
def avail(self):
|
||||
val = self.stat['size']
|
||||
return val
|
||||
@@ -37,9 +43,14 @@ class stats:
|
||||
def free(self):
|
||||
return self.stat['free_size']
|
||||
|
||||
def show(self):
|
||||
print ' Instance:',self.inst()
|
||||
print ' Avail:',self.avail()
|
||||
print ' Free:',self.free()
|
||||
|
||||
# ToDo : incorporate others
|
||||
|
||||
def control:
|
||||
class control:
|
||||
'''Abstract a heap control structure'''
|
||||
|
||||
def __init__(self, ctl):
|
||||
@@ -59,4 +70,15 @@ def control:
|
||||
|
||||
def stat(self):
|
||||
st = stats(self.ctl['stats'])
|
||||
return st
|
||||
return st
|
||||
|
||||
def show(self):
|
||||
fi = self.first()
|
||||
la = self.last()
|
||||
|
||||
print ' First:', fi.val()
|
||||
print ' Last:', la.val()
|
||||
|
||||
stats = self.stat()
|
||||
print ' stats:'
|
||||
stats.show()
|
Reference in New Issue
Block a user