<div dir="ltr">feel free to push back that "this is too Android-specific"... it's possible that a better answer to the Android Go folks' "i wish we always had this on the device" is to just always build it for the device as-is (or if we really want to hide it away, just bung it in the ghost of toolbox).</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 24, 2024 at 1:46 PM enh <<a href="mailto:enh@google.com">enh@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">This seems to be a popular reinvention. There are three different<br>variants in the Android tree, and at least another independent one<br>(intended for Android) on github.<br><br>This is the minimal intersection of them all, which will hopefully<br>still be useful. (It's very close to the system/extras/ Android<br>one, but assumes that the user can just run under nohup(1) rather<br>than needing the tool to daemonize itself.)<br><br>There's not much motivation for the for loop rather than a call to<br>memset(); that was just intended as paranoia against "can something<br>cheat me out of my dirty pages?". This still repeats every 256<br>bytes, though, and I don't have any concrete example of where<br>duplicate page detection or compression kicks in, so although<br>calloc() would not be a suitable replacement, memset() might well<br>be.<br>---<br> toys/pending/memeater.c | 31 +++++++++++++++++++++++++++++++<br> 1 file changed, 31 insertions(+)<br> create mode 100644 toys/pending/memeater.c<br><br></div>
</blockquote></div>