aboutsummaryrefslogtreecommitdiff
path: root/core/test/run-mem_region.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2014-10-16 18:05:08 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2014-10-17 11:55:16 +1100
commita8d479c63a4bbc99808a37f6958b3de517569918 (patch)
tree7729b87473edac0ec6a3576a1211a0b87c25446d /core/test/run-mem_region.c
parent78237cccad984a0d757e578ec2a9745de4fcfd87 (diff)
downloadskiboot-a8d479c63a4bbc99808a37f6958b3de517569918.zip
skiboot-a8d479c63a4bbc99808a37f6958b3de517569918.tar.gz
skiboot-a8d479c63a4bbc99808a37f6958b3de517569918.tar.bz2
Rename mem_size() to mem_allocated_size()
This better states the intention of what it should return. I was bit unsure when fixing mem_size(), so hopefully this makes future me (or other people) less unsure as to the intended return value of this function. No functional changes, just rename. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Rusty Russell <rusty@au1.ibm.com>
Diffstat (limited to 'core/test/run-mem_region.c')
-rw-r--r--core/test/run-mem_region.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/test/run-mem_region.c b/core/test/run-mem_region.c
index f0ad2c2..db1ca02 100644
--- a/core/test/run-mem_region.c
+++ b/core/test/run-mem_region.c
@@ -101,7 +101,7 @@ int main(void)
assert(!strcmp(((struct alloc_hdr *)p)[-1].location, "here"));
assert(p > (void *)test_heap);
assert(p + (1ULL << i) <= (void *)test_heap + TEST_HEAP_SIZE);
- assert(mem_size(&skiboot_heap, p) >= 1ULL << i);
+ assert(mem_allocated_size(p) >= 1ULL << i);
mem_free(&skiboot_heap, p, "freed");
assert(heap_empty());
assert(mem_check(&skiboot_heap));
@@ -177,7 +177,7 @@ int main(void)
p = mem_alloc(&skiboot_heap, 1, 1, "one byte");
assert(p);
assert(mem_resize(&skiboot_heap, p, 100, "hundred bytes"));
- assert(mem_size(&skiboot_heap, p) >= 100);
+ assert(mem_allocated_size(p) >= 100);
assert(mem_check(&skiboot_heap));
assert(!strcmp(((struct alloc_hdr *)p)[-1].location, "hundred bytes"));
mem_free(&skiboot_heap, p, "freed");
@@ -186,7 +186,7 @@ int main(void)
p = mem_alloc(&skiboot_heap, 100, 1, "100 bytes");
assert(p);
assert(mem_resize(&skiboot_heap, p, 1, "1 byte"));
- assert(mem_size(&skiboot_heap, p) < 100);
+ assert(mem_allocated_size(p) < 100);
assert(mem_check(&skiboot_heap));
assert(!strcmp(((struct alloc_hdr *)p)[-1].location, "1 byte"));
mem_free(&skiboot_heap, p, "freed");
@@ -196,7 +196,7 @@ int main(void)
assert(p);
for (i = 1; i <= TEST_HEAP_SIZE - sizeof(struct alloc_hdr); i++) {
assert(mem_resize(&skiboot_heap, p, i, "enlarge"));
- assert(mem_size(&skiboot_heap, p) >= i);
+ assert(mem_allocated_size(p) >= i);
assert(mem_check(&skiboot_heap));
}