/* > f_alloc.c

 * SJ Middleton, 1993

 */

#include "flex.h"

#include <stdlib.h>

#include "memalloc.h"
#include "mem_int.h"

BOOL f_alloc(void **anchor, size_t nbytes)
{
        BOOL success;
        if (*anchor)
                success = flex_extend(anchor, nbytes);
        else
                success = flex_alloc(anchor, nbytes);
        if (!success)
                alloc__checkerror(nbytes);

        alloc_nextiscalled(NULL);               /* clear name so it's not reused */
        alloc_nextmaxsize(-1);

        return success;
}

void f_free(void **anchor)
{
        if (*anchor)
        {
                flex_free(anchor);
                *anchor = NULL;
        }
}

/* eof f_alloc.c */
