Skip to content

Risk of causing bugs due to inconsistency in interfaces of AlignedTableTightAlloc #3994

@GKxxUCAS

Description

@GKxxUCAS

In faiss/utils/AlignedTable.h, in the class AlignedTableTightAlloc, we can see from the function resize that the pointer member ptr may be set to null. The copy constructor has taken this into consideration and has performed a check if (numel > 0) before passing ptr to memcpy (which was added in 74ee67a). However, the function clear does not seem to have realized this.

Maybe a check should also be performed in clear before calling memset?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions