- . (30 points) Implement function frame-refs that returns the set of all handles contained in the given
frame, according to the notion of contains introduced in Lecture 16. Hint: Consider using function
frame-fold. If your solution uses frame-fold, then the solution should not be recursive.
(-> frame? set?)
2. (20 points) Implement function (mem-mark contained mem ref) that returns the set of all reachable
handles from handle ref, and takes: contained a function that takes an element of the heap and
returns a set of handles contained in that element, mem is a heap, and ref is the initial handle, according to the memory sweep algorithm discussed in Lecture 16. An example of a contained function is
function frames-refs for a heap of frames. Notice that function mem-mark expects a heap of any data.
(-> (-> any/c set?) heap? handle? set?)
3. (10 points) Implement function (mem-sweep mem to-keep) that given a heap meThe post Implement function frame-refs that returns the set of all appeared first on Assignment Freelancers.