On Apple platforms, RLIMIT_RSS is mapped to RLIMIT_AS [1] and setting
RLIMIT_AS to a value smaller than the current virtual memory size
will fail. To avoid issues, first get the current size of the virtual
memory and add the user requested limit.
[1] https://github.com/apple/darwin-xnu/blob/a1babec6b135d1f35b2590a1990af3c5c5393479/bsd/sys/resource.h
We don't have to abort if proc_pidinfo fails, but we should be resilient to that. Maybe explicitly initialize task_info to 0 first? If you can't because it's opaque, I guess you do have to check for success after all ;)