[panda-users] inlining of functions in panda/common.h?

Manolis Stamatogiannakis mstamat at gmail.com
Mon Oct 1 09:39:43 EDT 2018


I had this in the back of my mind for some time, but today I gave it a try
to see the effects.

Many functions declared in panda/common.h are only thin wrappers around
other functions. E.g.:
int panda_physical_memory_rw(hwaddr addr, uint8_t *buf, int len, int
is_write);
hwaddr panda_virt_to_phys(CPUState *env, target_ulong addr);
int panda_virtual_memory_rw(CPUState *env, target_ulong addr, uint8_t *buf,
int len, int is_write);
int panda_virtual_memory_read(CPUState *env, target_ulong addr, uint8_t
*buf, int len);
int panda_virtual_memory_write(CPUState *env, target_ulong addr, uint8_t
*buf, int len);

Is there any reason these have not been implemented as inlines?

After inlining them (a 5' task), my reply replay ran ~5% faster (141.7sec
-> 133.7sec). Not a huge improvement, but given the effort required for the
change, one can't complain.

Thanks,
Manolis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/panda-users/attachments/20181001/09cdaf86/attachment.html


More information about the panda-users mailing list