Skip to content

Simplify memory handling #437

Description

@wincent

Not sure if this will be any better but teach the scanner "class" to take a pointer to a cleanup function and a void * pointer to be passed to it.

We would pass perhaps three different kinds of function to it. One would just free owned slabs passed in from elsewhere, the other would not free unowned slabs but instead call a deallocation function for the thing that does own them (eg. a watchman response instance, for example). The other (perhaps the same as the first) would free owned slabs the scanner itself had created.

The idea of all this is to make things more uniform and consistent, and perhaps allow us to get rid of the ghastly weak table1.

Footnotes

  1. See description of where it is used and description of big picture.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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