[Toybox] [PATCH] memeater: consume a given amount of memory.
enh
enh at google.com
Wed Jan 24 13:47:53 PST 2024
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).
On Wed, Jan 24, 2024 at 1:46 PM enh <enh at google.com> wrote:
> This seems to be a popular reinvention. There are three different
> variants in the Android tree, and at least another independent one
> (intended for Android) on github.
>
> This is the minimal intersection of them all, which will hopefully
> still be useful. (It's very close to the system/extras/ Android
> one, but assumes that the user can just run under nohup(1) rather
> than needing the tool to daemonize itself.)
>
> There's not much motivation for the for loop rather than a call to
> memset(); that was just intended as paranoia against "can something
> cheat me out of my dirty pages?". This still repeats every 256
> bytes, though, and I don't have any concrete example of where
> duplicate page detection or compression kicks in, so although
> calloc() would not be a suitable replacement, memset() might well
> be.
> ---
> toys/pending/memeater.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
> create mode 100644 toys/pending/memeater.c
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20240124/25e495c2/attachment.htm>
More information about the Toybox
mailing list