[[!meta copyright="Copyright © 2013 Free Software Foundation, Inc."]] [[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [[GNU Free Documentation License|/fdl]]."]]"""]] [[!tag open_issue_documentation]] Some coding style comments that are specific to Hurd systems. [[!toc]] # Freeing Port Rights ## IRC, freenode, #hurd, 2013-07-01 do I have to explicitly free ports in a short lived process like mount? better take the habit of doing that anyway how do I recognize that I have to free something? mig spec? i'd say no mig does it for you gnumach reference manual not memory, like port rights but no, really, for short lived processes it's ok yes, port rights like memory, you don't free stuff in short lived processes :p mach does it correctly when the task is destroyed but there are two use cases for rights those you create manually and those mig creates for its own purpose ignore those used by mig, they matter only in very specific parts of glibc and other very low level stuff teythoon: keep in mind that there are two flavours of resources with port rights but how do I *know* from looking at say fs.defs that I have to free anything I get? rights themselves, and the user reference count per right eh, that's complicated in a complete RPC call, you must watch two things usually out of line memory and right references except otherwise mentioned, you don't have to free anything freeing passed memory should be obvious (e.g. "out" keyword on a memory range) for right references, it's less obvious refer to the mach server writing guide i guess what does the dealloc qualifier do in mig defs? basically, send rights can be created from a receive right (make_send), or another send right (copy_send) it tells mig which function to call once an RPC has returned all this is described in the mach server writing guide and it's tricky quite error-prone so check with portinfo