fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct mblock {
  5.  
  6. void *hybrid_data;
  7. };
  8.  
  9. struct hybrid_map {
  10. unsigned int hybrid_zone_id;
  11. unsigned int chunk_index[32768];
  12. };
  13.  
  14. int main(void) {
  15.  
  16. struct mblock *mblk;
  17. struct hybrid_map *hmap;
  18. mblk = malloc(sizeof(struct mblock));
  19. hmap = mblk->hybrid_data;
  20.  
  21. printf("mblock: %p, hmap: %d\n", mblk, sizeof(hmap));
  22. printf("mblk->hybrid_zone_id: %u\n", sizeof(hmap->hybrid_zone_id));
  23.  
  24. free(mblk);
  25.  
  26. printf("mblock: %p, hmap: %d\n", mblk, sizeof(hmap));
  27. printf("mblk->hybrid_zone_id: %u\n", sizeof(hmap->hybrid_zone_id));
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
mblock: 0x5642241ea260, hmap: 8
mblk->hybrid_zone_id: 4
mblock: 0x5642241ea260, hmap: 8
mblk->hybrid_zone_id: 4