[hack] Refactor SharedMem.WithCache
[hack] Refactor SharedMem.WithCache

Summary:
SharedMem.WithCache is supposed to be the same as SharedMem.NoCache except it caches items in the new heap. This isn't clear at all from the implementation so I cleaned it up so its more obvious.

This is some clean up before the larger shelve/unshelve refactor

Reviewed By: jopamer

Differential Revision: D4024202

fbshipit-source-id: 138a5cd4db283bcee5c28ebd05403eb313637549

mroch/flow,jamesgpearce/flow,ylu1317/flow,facebook/flow,facebook/flow,MichaelDeBoey/flow,AgentME/flow,TiddoLangerak/flow,facebook/flow,jgrund/flow,JonathanUsername/flow,nmote/flow,AprilArcus/flow,jgrund/flow,gabro/flow,fletcherw/flow,popham/flow,gabro/flow,ForbesLindesay/flow,JonathanUsername/flow,jamesgpearce/flow,gabelevi/flow,facebook/flow,popham/flow,nmote/flow,jamesgpearce/flow,mroch/flow,ForbesLindesay/flow,nmote/flow,mroch/flow,nmote/flow,mroch/flow,fletcherw/flow,gabro/flow,claudiopro/flow,fletcherw/flow,AprilArcus/flow,gabro/flow,JonathanUsername/flow,AprilArcus/flow,jamesgpearce/flow,nmote/flow,popham/flow,claudiopro/flow,gabro/flow,facebook/flow,claudiopro/flow,AprilArcus/flow,JonathanUsername/flow,ylu1317/flow,fletcherw/flow,samwgoldman/flow,popham/flow,popham/flow,jgrund/flow,fletcherw/flow,JonathanUsername/flow,ForbesLindesay/flow,ylu1317/flow,gabelevi/flow,facebook/flow,AgentME/flow,popham/flow,gabelevi/flow,samwgoldman/flow,mroch/flow,MichaelDeBoey/flow,nmote/flow,ForbesLindesay/flow,mroch/flow,mroch/flow,jgrund/flow,claudiopro/flow,jamesgpearce/flow,AprilArcus/flow,AgentME/flow,ylu1317/flow,AprilArcus/flow,TiddoLangerak/flow,gabelevi/flow,samwgoldman/flow,AgentME/flow,jamesgpearce/flow,ForbesLindesay/flow,nmote/flow,gabelevi/flow,gabro/flow,samwgoldman/flow,AgentME/flow,MichaelDeBoey/flow,ForbesLindesay/flow,MichaelDeBoey/flow,claudiopro/flow,fletcherw/flow,jgrund/flow,facebook/flow,TiddoLangerak/flow,ylu1317/flow,jgrund/flow,TiddoLangerak/flow,samwgoldman/flow,samwgoldman/flow,gabelevi/flow,JonathanUsername/flow,JonathanUsername/flow,samwgoldman/flow,jamesgpearce/flow,MichaelDeBoey/flow,TiddoLangerak/flow,popham/flow,gabelevi/flow