Home | History | Annotate | Download | only in libdex

Lines Matching refs:map

18  * Verification-time map of data section items
34 DexDataMap* map = NULL;
45 map = (DexDataMap*) malloc(size);
47 if (map == NULL) {
51 map->count = 0;
52 map->max = maxCount;
53 map->offsets = (u4*) (map + 1);
54 map->types = (u2*) (map->offsets + maxCount);
56 return map;
62 void dexDataMapFree(DexDataMap* map) {
68 free(map);
72 * Add a new element to the map. The offset must be greater than the
75 void dexDataMapAdd(DexDataMap* map, u4 offset, u2 type) {
76 assert(map != NULL);
77 assert(map->count < map->max);
79 if ((map->count != 0) &&
80 (map->offsets[map->count - 1] >= offset)) {
81 ALOGE("Out-of-order data map offset: %#x then %#x",
82 map->offsets[map->count - 1], offset);
86 map->offsets[map->count] = offset;
87 map->types[map->count] = type;
88 map->count++;
95 int dexDataMapGet(DexDataMap* map, u4 offset) {
96 assert(map != NULL);
100 int max = map->count - 1;
101 u4* offsets = map->offsets;
113 return map->types[guessIdx];
122 * Verify that there is an entry in the map, mapping the given offset to
126 bool dexDataMapVerify(DexDataMap* map, u4 offset, u2 type) {
127 int found = dexDataMapGet(map, offset);
134 ALOGE("No data map entry found @ %#x; expected %x",
137 ALOGE("Unexpected data map entry @ %#x: expected %x, found %x",