freemyipod r473 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r472‎ | r473 | r474 >
Date:03:45, 22 January 2011
Author:farthen
Status:new
Tags:
Comment:
libemcore: Fix an obvious bug in free() and implement free_all() which implements monitor command 57 introduced by r471
Modified paths:
  • /emcore/trunk/tools/libemcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/libemcore.py
@@ -883,8 +883,14 @@
884884 def free(self, ptr):
885885 """ Frees the memory space pointed to by 'ptr' """
886886 self.logger.debug("Freeing the memory region at 0x%x\n" % ptr)
887 - return self.lib.monitorcommand(struct.pack("IIII", 56, addr, 0, 0), "III", (None, None, None))
 887+ return self.lib.monitorcommand(struct.pack("IIII", 56, ptr, 0, 0), "III", (None, None, None))
888888
 889+ @command()
 890+ def free_all(self):
 891+ """ Frees all memory allocations created by the monitor thread """
 892+ self.logger.debug("Freeing all memory allocations created by the monitor thread\n")
 893+ return self.lib.monitorcommand(struct.pack("IIII", 57, 0, 0, 0), "III", (None, None, None))
 894+
889895
890896 class Lib(object):
891897 def __init__(self, logger):

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r471emCORE: Add USB Monitor API to free all allocations held by the monitor threadtheseven03:06, 22 January 2011