X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Flist.c;h=4ffa8837756c36264094bf4729eea26faedc0eaf;hb=b46ccdf582946f30d80735345c533c23a7f035c0;hp=8aedd7573656cbc4beedd514019c42a855bdb686;hpb=a14bc59fb8f27db193d74662dc9c5cb8237177ef;p=openvswitch diff --git a/lib/list.c b/lib/list.c index 8aedd757..4ffa8837 100644 --- a/lib/list.c +++ b/lib/list.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,14 @@ list_init(struct list *list) list->next = list->prev = list; } +/* Initializes 'list' with pointers that will (probably) cause segfaults if + * dereferenced and, better yet, show up clearly in a debugger. */ +void +list_poison(struct list *list) +{ + memset(list, 0xcc, sizeof *list); +} + /* Inserts 'elem' just before 'before'. */ void list_insert(struct list *before, struct list *elem)