Following up on this bug report, the memory-limit function should be marked obsolescent and eventually removed, as its value has not been useful (or, as far as I can tell, used) for many years. Until it's removed it can just return 0. Proposed patch attached.