Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Use __attribute__((malloc)) on memory allocation functions
- This informs the C compiler that pointers returned from these functions
- do not alias other functions, which allows it to do better code
- optimization and should make the compiled code smaller.
- References:
- https://stackoverflow.com/a/53654773
- https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-malloc-function-attribute
- https://clang.llvm.org/docs/AttributeReference.html#malloc
- Reviewed-by: Brian Behlendorf <[email protected]>
- Signed-off-by: Richard Yao <[email protected]>
- Closes #14827
- # Please enter the commit message for your changes. Lines starting
- # with '#' will be ignored, and an empty message aborts the commit.
- #
- # Author: Richard Yao <[email protected]>
- # Date: Fri May 26 18:47:52 2023 -0400
- #
- # interactive rebase in progress; onto 0f03a4116
- # No commands done.
- # Next commands to do (3 remaining commands):
- # s 6f2ce494d zfs-create(8): grammar, caution
- # s a90829e3a zfs-create(8): ZFS for swap: mention the FAQ doc
- # You are currently editing a commit while rebasing branch 'patch-1' on '0f03a4116'.
- #
- # Changes to be committed:
- # modified: include/os/freebsd/spl/sys/kmem.h
- # modified: include/os/linux/spl/sys/kmem.h
- # modified: include/os/linux/spl/sys/vmem.h
- # modified: include/sys/abd.h
- # modified: lib/libspl/include/umem.h
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement