#NEWLINE# @ _ffi . callback ( 'void*(*)(void*, size_t)' ) #NEWLINE# def realloc( p , n ) : #NEWLINE# #INDENT# memory = C . realloc ( p , n ) #NEWLINE# old = heap . pop ( p ) #NEWLINE# python_stack = traceback . extract_stack ( limit = 3 ) #NEWLINE# c_stack = _backtrace ( ) #NEWLINE# old . append ( ( n , python_stack , c_stack ) ) #NEWLINE# heap [ memory ] = old #NEWLINE# log ( ( 'realloc(0x%x, %d) -> %s' % ( int ( _ffi . cast ( 'int' , p ) ) , n , memory ) ) ) #NEWLINE# return memory