mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
Add asserts to address map / address set
This commit is contained in:
parent
95868c70a2
commit
4be3e69ac1
2 changed files with 6 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "address-hash.h"
|
||||
#include "gc-assert.h"
|
||||
|
||||
struct hash_map_entry {
|
||||
uintptr_t k;
|
||||
|
@ -28,7 +29,9 @@ static void hash_map_clear(struct hash_map *map) {
|
|||
static void hash_map_init(struct hash_map *map, size_t size) {
|
||||
map->size = size;
|
||||
map->data = malloc(sizeof(struct hash_map_entry) * size);
|
||||
if (!map->data) GC_CRASH();
|
||||
map->bits = malloc(size / 8);
|
||||
if (!map->bits) GC_CRASH();
|
||||
hash_map_clear(map);
|
||||
}
|
||||
static void hash_map_destroy(struct hash_map *map) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue