2007-10-17 13:25:44 +00:00
|
|
|
#include <stdlib.h>
|
2003-10-31 23:34:40 +00:00
|
|
|
#include "iob_internal.h"
|
|
|
|
|
2007-10-17 13:25:44 +00:00
|
|
|
static void cleanup(struct iob_entry* x) {
|
|
|
|
free((char*)x->buf);
|
|
|
|
}
|
|
|
|
|
2003-10-31 23:42:04 +00:00
|
|
|
int iob_addbuf_free(io_batch* b,const void* buf,uint64 n) {
|
2012-02-24 02:00:52 +00:00
|
|
|
int r=iob_addbuf_internal(b,buf,n,cleanup);
|
|
|
|
if (r==0)
|
|
|
|
free((char*)buf);
|
|
|
|
return r;
|
2003-10-31 23:34:40 +00:00
|
|
|
}
|