X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fhmap.c;h=4c97e2359c922034cc8389344dc2a581227042d7;hb=8ef8acb7c70a321963d30f2264e8f91e16427fcf;hp=081d7cbba5a5f3e607f6a0dc3bfb90176a796a06;hpb=ef35211c05259417e4f3dd4a7de44e92e4bc54a3;p=pspp-builds.git diff --git a/src/libpspp/hmap.c b/src/libpspp/hmap.c index 081d7cbb..4c97e235 100644 --- a/src/libpspp/hmap.c +++ b/src/libpspp/hmap.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,8 @@ #include #include +#include "xalloc.h" + static size_t capacity_to_mask (size_t capacity); /* Initializes MAP as a new hash map that is initially empty. */ @@ -75,7 +77,7 @@ hmap_rehash (struct hmap *map, size_t new_mask) assert ((new_mask & (new_mask + 1)) == 0); if (new_mask) - new_buckets = calloc (new_mask + 1, sizeof *new_buckets); + new_buckets = xcalloc (new_mask + 1, sizeof *new_buckets); else { new_buckets = &map->one;