|
@@ -141,7 +141,7 @@ void map__init(struct map *map, enum map_type type,
|
|
|
RB_CLEAR_NODE(&map->rb_node);
|
|
|
map->groups = NULL;
|
|
|
map->erange_warned = false;
|
|
|
- atomic_set(&map->refcnt, 1);
|
|
|
+ refcount_set(&map->refcnt, 1);
|
|
|
}
|
|
|
|
|
|
struct map *map__new(struct machine *machine, u64 start, u64 len,
|
|
@@ -255,7 +255,7 @@ void map__delete(struct map *map)
|
|
|
|
|
|
void map__put(struct map *map)
|
|
|
{
|
|
|
- if (map && atomic_dec_and_test(&map->refcnt))
|
|
|
+ if (map && refcount_dec_and_test(&map->refcnt))
|
|
|
map__delete(map);
|
|
|
}
|
|
|
|
|
@@ -354,7 +354,7 @@ struct map *map__clone(struct map *from)
|
|
|
struct map *map = memdup(from, sizeof(*map));
|
|
|
|
|
|
if (map != NULL) {
|
|
|
- atomic_set(&map->refcnt, 1);
|
|
|
+ refcount_set(&map->refcnt, 1);
|
|
|
RB_CLEAR_NODE(&map->rb_node);
|
|
|
dso__get(map->dso);
|
|
|
map->groups = NULL;
|