def METHOD_NAME(mallocs, trace_records, printer=prof.default_printer):
    for t in trace_records:
        l = str(t)
        try:
            #
            # Maintain a hash dictionary that maps between buffer address and
            # a list of object, each describing the buffer: its requested and
            # actual size, alignment and allocator.
            #
            if is_mempool(l) or is_large(l) or is_page(l):
                buf = get_buf(l)
                b = Buffer(buf,
                           alloc_type=get_type(l),
                           alloc_len=get_alloc_len(l),
                           req_len=get_req_len(l),
                           align=get_align(l),
                           backtrace=t.backtrace)
                if buf in mallocs:
                    mallocs[buf] += [b]
                else:
                    mallocs[buf] = [b]
        except:
            printer("Problem parsing line: '%s'\n" % l)
            raise