};
+/**
+ * Get the number of the addresses set per element in the bloom filter.
+ *
+ * @param bf the filter
+ * @return addresses set per element in the bf
+ */
+size_t
+GNUNET_CONTAINER_bloomfilter_get_element_addresses (const struct GNUNET_CONTAINER_BloomFilter
+ *bf)
+{
+ if (bf == NULL)
+ return 0;
+ return bf->addressesPerElement;
+}
+
/**
* Get size of the bloom filter.
ui *= 2;
size = ui; /* make sure it's a power of 2 */
- bf = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_BloomFilter));
+ bf = GNUNET_new (struct GNUNET_CONTAINER_BloomFilter);
/* Try to open a bloomfilter file */
if (GNUNET_YES == GNUNET_DISK_file_test (filename))
bf->fh =
if ((0 == k) || (0 == size))
return NULL;
- bf = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_BloomFilter));
+ bf = GNUNET_new (struct GNUNET_CONTAINER_BloomFilter);
bf->filename = NULL;
bf->fh = NULL;
bf->bitArray = GNUNET_malloc_large (size);