From: Ben Pfaff Date: Tue, 7 Jun 2011 20:16:37 +0000 (-0700) Subject: list: Clarify description of list_moved(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3c4dc652ff62b2444a1cd5bd92f9a5fccacab6b;p=openvswitch list: Clarify description of list_moved(). This function doesn't have any users, but an upcoming commit will add one. --- diff --git a/lib/list.c b/lib/list.c index b5fa3893..a236f8c7 100644 --- a/lib/list.c +++ b/lib/list.c @@ -90,7 +90,11 @@ list_replace(struct list *element, const struct list *position) } /* Adjusts pointers around 'list' to compensate for 'list' having been moved - * around in memory (e.g. as a consequence of realloc()). */ + * around in memory (e.g. as a consequence of realloc()). + * + * This always works if 'list' is a member of a list, or if 'list' is the head + * of a non-empty list. It fails badly, however, if 'list' is the head of an + * empty list; just use list_init() in that case. */ void list_moved(struct list *list) {