Skip to content

Commit 5f227d4

Browse files
committed
just update comments
1 parent 94e0525 commit 5f227d4

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tests/verify_tag_ptr_test.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,24 @@ int main(int argc, char *argv[]) {
1919
abort();
2020
}
2121

22+
/* Allocate a chunk, and assign a tagged pointer to p */
2223
void *p = iso_alloc_from_zone_tagged(_zone_handle);
24+
25+
/* Remove the tag from the pointer */
2326
void *up = iso_alloc_untag_ptr(p, _zone_handle);
27+
28+
/* Free the underlying chunk with the untagged pointer */
2429
iso_free_from_zone(up, _zone_handle);
30+
31+
/* Flush all caches includes the delayed free list. When
32+
* the chunk is free'd its tag will be changed */
2533
iso_flush_caches();
26-
/* The free() path will have changed the tag for this pointer */
34+
35+
/* Verify the tag on our stale tagged pointer. This should
36+
* abort because the tag was changed during free() */
2737
iso_alloc_verify_ptr_tag(p, _zone_handle);
28-
iso_alloc_destroy_zone(_zone_handle);
2938

30-
#if !MEMORY_TAGGING
31-
return -1;
32-
#endif
39+
iso_alloc_destroy_zone(_zone_handle);
3340

3441
return 0;
3542
}

0 commit comments

Comments
 (0)