Saves a stack object to a flatfile.

    :param caliendo.hooks.CallStack stack: The stack to save.

def save_stack(stack):
    """
    Saves a stack object to a flatfile.

    :param caliendo.hooks.CallStack stack: The stack to save.

    """
    global CACHE_
    serialized = pickle.dumps(stack, PPROT)
    CACHE_['stacks']["{0}.{1}".format(stack.module, stack.caller)] = serialized
    write_out()