Skip to content

Just issue after delete  #1

@kwccoin

Description

@kwccoin

reading your source under

https://www.cs.colorado.edu/~kena/classes/5448/f12/presentation-materials/gatchell.pdf

I think the delete and the find logic has some issues. If you delete the object, your find logic using assert is not ok. Basically you rely upon

set - heap -> in set
MANY -> new and drop and hence not in set
0 -> delete

But the assert in find assume only in set or new or drop but not delete case.

Hence instead of

 assert(* element);  // problem with this statement as it could be 0 after delete!!!
 return * element == set - heap ? (void *) element : 0;

You should

return * element == set - heap ? (void *) element : 0;

For your kind consideration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions