site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Folks, As an example, from vn.c: static int file_io(struct vnode * vp, struct vfs_context * context_p, enum uio_rw op, char * base, off_t offset, user_ssize_t count, user_ssize_t * resid) { uio_t auio; int error; char uio_buf[UIO_SIZEOF(1)]; auio = uio_createwithbuffer(1, offset, UIO_SYSSPACE, op, &uio_buf[0], sizeof(uio_buf)); uio_addiov(auio, CAST_USER_ADDR_T(base), count); if (op == UIO_READ) error = VNOP_READ(vp, auio, IO_SYNC, context_p); else error = VNOP_WRITE(vp, auio, IO_SYNC, context_p); if (resid != NULL) { *resid = uio_resid(auio); } return (error); } Best Regards, Ron Aldrich Software Architects, Inc. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I'm looking through the darwin sources, to determine how to update those portions of my kext which use uiomove, and I see what appear to be memory leaks all over the kernel. In those parts of the kernel that use uio_create to construct a uio object, they invariably call uio_free to dispose of it (as you would expect). However, in those parts of the kernel that use uio_createwithbuffer to create a uio object, uio_free is NOT called, and the uio object is leaked. My question is, is this actually correct code? Or am I right that it leaks a uio object every time it's called? This email sent to site_archiver@lists.apple.com
participants (1)
-
Ron Aldrich