From 0619e08092365ffa899d2debd821172cd5b39a8b Mon Sep 17 00:00:00 2001 From: leitner Date: Thu, 20 Mar 2025 12:39:46 +0000 Subject: [PATCH] fix ownership annotations. clang's aren't as good as I hoped --- buffer.h | 3 --- iob.h | 2 -- 2 files changed, 5 deletions(-) diff --git a/buffer.h b/buffer.h index 04c4624..7d99b47 100644 --- a/buffer.h +++ b/buffer.h @@ -35,7 +35,6 @@ typedef struct buffer { /* Initialize a buffer with an existing memory area, which the buffer * will NOT take ownership of (i.e. won't free the memory when it's done) */ __bufout(4,5) -att_holds(malloc,4) void buffer_init(buffer* b, ssize_t (*op)(), int fd, char* y, size_t ylen); /* Initialize a buffer with an existing memory area, which the buffer @@ -47,13 +46,11 @@ void buffer_init_free(buffer* b,ssize_t (*op)(),int fd,char* y,size_t ylen); /* Call buffer_init with op=read(), return 0. * If fd==-1, return -1 instead, leaving b untouched. */ __bufout(3,4) -att_holds(malloc,3) int buffer_init_read(buffer* b, int fd, char* y, size_t ylen); /* Call buffer_init with op=write(), return 0. * If fd==-1, return -1 instead, leaving b untouched. */ __bufout(3,4) -att_holds(malloc,3) int buffer_init_write(buffer* b, int fd, char* y, size_t ylen); /* Will allocate a buffer of size ylen and then call diff --git a/iob.h b/iob.h index 5c78629..32660ed 100644 --- a/iob.h +++ b/iob.h @@ -69,7 +69,6 @@ io_batch* iob_new_autofree(size_t hint_entries); /* queue buffer in io_batch */ att_readn(2,3) -att_holds(malloc,2) int iob_addbuf(io_batch* b,const void* buf,uint64 n); /* queue buffer in io_batch, and give ownership to batch. */ @@ -85,7 +84,6 @@ int iob_addbuf_munmap(io_batch* b,const void* buf,uint64 n); /* queue asciiz string in io_batch. */ att_read(2) -att_holds(malloc,2) int iob_adds(io_batch* b,const char* s); /* queue asciiz string in io_batch, and give ownership to batch. */