diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-05-12 09:15:34 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-05-12 09:20:48 +0200 |
| commit | b5747d2579a2dbda0769ae0d246d7b8bf5683694 (patch) | |
| tree | ec1dcf383b5105a20a0eb27974c24492dfcc6398 /miasm/os_dep/common.py | |
| parent | 894f4453fabf967002cd2395f56f34d76b2c97ed (diff) | |
| download | focaccia-miasm-b5747d2579a2dbda0769ae0d246d7b8bf5683694.tar.gz focaccia-miasm-b5747d2579a2dbda0769ae0d246d7b8bf5683694.zip | |
Add comments to heap allocations
Diffstat (limited to 'miasm/os_dep/common.py')
| -rw-r--r-- | miasm/os_dep/common.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/miasm/os_dep/common.py b/miasm/os_dep/common.py index 4a92ef2a..74100817 100644 --- a/miasm/os_dep/common.py +++ b/miasm/os_dep/common.py @@ -71,15 +71,15 @@ class heap(object): self.addr &= self.mask ^ (self.align - 1) return ret - def alloc(self, jitter, size, perm=PAGE_READ | PAGE_WRITE): + def alloc(self, jitter, size, perm=PAGE_READ | PAGE_WRITE, cmt=""): """ @jitter: a jitter instance @size: the size to allocate @perm: permission flags (see vm_alloc doc) """ - return self.vm_alloc(jitter.vm, size, perm) + return self.vm_alloc(jitter.vm, size, perm=perm, cmt=cmt) - def vm_alloc(self, vm, size, perm=PAGE_READ | PAGE_WRITE): + def vm_alloc(self, vm, size, perm=PAGE_READ | PAGE_WRITE, cmt=""): """ @vm: a VmMngr instance @size: the size to allocate @@ -91,7 +91,7 @@ class heap(object): addr, perm, b"\x00" * (size), - "Heap alloc by %s" % get_caller_name(2) + "Heap alloc by %s %s" % (get_caller_name(2), cmt) ) return addr |