#include <stdio.h>
#include <stdlib.h>
#include <limits.h> // UINT_MAX를 사용하기 위해 필요
struct dmz_mblock {
void *hybrid_data;
};
struct hybrid_map {
unsigned int hybrid_zone_id;
unsigned int chunk_index[32768];
};
int main(void) {
struct dmz_mblock
*dmz_mblk
= malloc(sizeof(struct dmz_mblock
)); if (!dmz_mblk) {
printf("Failed to allocate memory for dmz_mblk\n"); return -1;
}
struct hybrid_map
*hmap
= malloc(sizeof(struct hybrid_map
)); hmap = (struct hybrid_map *) dmz_mblk->hybrid_data;
printf("sizeof dmz_mblk->hybrid_data: %u, hmap: %u\n", sizeof(dmz_mblk
->hybrid_data
), sizeof(hmap
));
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPGxpbWl0cy5oPiAgLy8gVUlOVF9NQVjrpbwg7IKs7Jqp7ZWY6riwIOychO2VtCDtlYTsmpQKCnN0cnVjdCBkbXpfbWJsb2NrIHsKICAgIHZvaWQgKmh5YnJpZF9kYXRhOwp9OwoKc3RydWN0IGh5YnJpZF9tYXAgewogICAgdW5zaWduZWQgaW50IGh5YnJpZF96b25lX2lkOwogICAgdW5zaWduZWQgaW50IGNodW5rX2luZGV4WzMyNzY4XTsKfTsKCmludCBtYWluKHZvaWQpIHsKICAgIHN0cnVjdCBkbXpfbWJsb2NrICpkbXpfbWJsayA9IG1hbGxvYyhzaXplb2Yoc3RydWN0IGRtel9tYmxvY2spKTsKICAgIGlmICghZG16X21ibGspIHsKICAgICAgICBwcmludGYoIkZhaWxlZCB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yIGRtel9tYmxrXG4iKTsKICAgICAgICByZXR1cm4gLTE7CiAgICB9CgoJc3RydWN0IGh5YnJpZF9tYXAgKmhtYXAgPSBtYWxsb2Moc2l6ZW9mKHN0cnVjdCBoeWJyaWRfbWFwKSk7CglobWFwID0gKHN0cnVjdCBoeWJyaWRfbWFwICopIGRtel9tYmxrLT5oeWJyaWRfZGF0YTsKCgoJcHJpbnRmKCJzaXplb2YgZG16X21ibGstPmh5YnJpZF9kYXRhOiAldSwgaG1hcDogJXVcbiIsIHNpemVvZihkbXpfbWJsay0+aHlicmlkX2RhdGEpLCBzaXplb2YoaG1hcCkpOwoKCgoKICAgIHJldHVybiAwOwp9Cg==