[llvm-bugs] [Bug 38129] New: alloc_size attribute does not work on functions returning a struct containing a pointer

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 11 02:02:43 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38129

            Bug ID: 38129
           Summary: alloc_size attribute does not work on functions
                    returning a struct containing a pointer
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

I am trying to implementing P0901r0 [0] in jemalloc. The signature of the new
memory allocation function looks like this: 

typedef struct {
        void *ptr;
        size_t usize;
} smallocx_return_t;
smallocx_return_t je_smallocx(size_t size, int flags); 

I have to set the alloc_size attribute for smallocx_return_t.ptr, but AFAICT
this is not currently possible. 

[0]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0901r0.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180711/6c78fc9a/attachment.html>


More information about the llvm-bugs mailing list