gcc 编译 Melon 使用

13 阅读1分钟
git clone https://github.com/Water-Melon/Melon.git
cd Melon
./configure --prefix=/usr/local
make
make install
#include <stdio.h>
#include "mln_alloc.h"

int main(int argc, char *argv[])
{
    char *ptr;
    mln_alloc_t *pool;

    pool = mln_alloc_init(NULL);

    ptr = mln_alloc_m(pool, 1024);
    printf("%p\n", ptr);
    mln_alloc_free(ptr);

    mln_alloc_destroy(pool);
    return 0;
}

gcc -o hello melon_demo.c -I/usr/local/include/ -L/usr/local/lib -lmelon