@classmethod
def set_allocator_library(cls, path):
    """ Change the allocator used by Xlnk instances

        This should only be called when there are no allocated buffers - 
        using or freeing any pre-allocated buffers after calling this
        function will result in undefined behaviour. This function
        is needed for SDx based designs where it is desired that PYNQ
        and SDx runtime share an allocator. In this case, this function
        should be called with the SDx compiled shared library prior to
        any buffer allocation

        If loading of the library fails an exception will be raised, 
        Xlnk.libxlnk_path will be unchanged and the old allocator will
        still be in use.

        Parameters
        ----------
        path : str
            Path to the library to load

        """
    cls._open_library(path)
    cls.libxlnk_path = path
