|
From: <sv...@va...> - 2015-04-30 12:16:56
|
Author: florian
Date: Thu Apr 30 13:16:44 2015
New Revision: 15161
Log:
Update comment for VG_(am_alloc_client_dataseg). Also pick a
better parameter name.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Thu Apr 30 13:16:44 2015
@@ -2916,21 +2916,23 @@
/*--- ---*/
/*-----------------------------------------------------------------*/
-/* Allocate the client data segment at address BASE with size SIZE. It is
- an expandable anonymous mapping abutting a shrinkable reservation segment.
+/* Allocate the client data (brk) segment at address BASE. The brk segment
+ can be at most MAX_SIZE bytes large. It is represented as an expandable
+ anonymous mapping abutted towards lower addresses by a shrinkable
+ reservation segment. The initial size of the anonymous mapping is 1 page.
BASE is the preferred address for the data segment but cannot be
guaranteed. Therefore, if successful, the function returns the actual
base address of the data segment, possibly different from BASE. If the
data segment could not be allocated the function returns an error. */
-SysRes VG_(am_alloc_client_dataseg) ( Addr base, SizeT size )
+SysRes VG_(am_alloc_client_dataseg) ( Addr base, SizeT max_size )
{
Bool ok;
Addr anon_start = base;
SizeT anon_size = VKI_PAGE_SIZE;
Addr resvn_start = anon_start + anon_size;
- SizeT resvn_size = size - anon_size;
+ SizeT resvn_size = max_size - anon_size;
- aspacem_assert(size > anon_size); // avoid wrap-around for resvn_size
+ aspacem_assert(max_size > anon_size); // avoid wrap-around for resvn_size
aspacem_assert(VG_IS_PAGE_ALIGNED(anon_size));
aspacem_assert(VG_IS_PAGE_ALIGNED(resvn_size));
aspacem_assert(VG_IS_PAGE_ALIGNED(anon_start));
|