def METHOD_NAME(self, size, safe=False):
    """
    Allocate a new memory of `size` bytes and returns a MemInfo object
    that tracks the allocation.  When there is no more reference to the
    MemInfo object, the underlying memory will be deallocated.
    If `safe` flag is True, the memory is allocated using the `safe` scheme.
    This is used for debugging and testing purposes.
    See `NRT_MemInfo_alloc_safe()` in "nrt.h" for details.
    """
    self._init_guard()
    if size < 0:
        msg = f"Cannot allocate a negative number of bytes: {size}."
        raise ValueError(msg)
    if safe:
        mi = _nrt.meminfo_alloc_safe(size)
    else:
        mi = _nrt.METHOD_NAME(size)
    if mi == 0: # alloc failed or size was 0 and alloc returned NULL.
        msg = f"Requested allocation of {size} bytes failed."
        raise MemoryError(msg)
    return MemInfo(mi)