Add a getter for the mem_pool_t base address

This commit is contained in:
Martin Willi
2012-08-24 11:19:07 +02:00
parent da646ab94a
commit d8eec395b2
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -162,6 +162,12 @@ METHOD(mem_pool_t, get_name, const char*,
return this->name;
}
METHOD(mem_pool_t, get_base, host_t*,
private_mem_pool_t *this)
{
return this->base;
}
METHOD(mem_pool_t, get_size, u_int,
private_mem_pool_t *this)
{
@@ -463,6 +469,7 @@ mem_pool_t *mem_pool_create(char *name, host_t *base, int bits)
INIT(this,
.public = {
.get_name = _get_name,
.get_base = _get_base,
.get_size = _get_size,
.get_online = _get_online,
.get_offline = _get_offline,
+7
View File
@@ -38,6 +38,13 @@ struct mem_pool_t {
*/
const char* (*get_name)(mem_pool_t *this);
/**
* Get the base (first) address of this pool.
*
* @return base address, internal host
*/
host_t* (*get_base)(mem_pool_t *this);
/**
* Get the size (i.e. number of addresses) of this pool.
*