Home | History | Annotate | Download | only in libdex

Lines Matching refs:map

18  * Verification-time map of data section items
34 DexDataMap* map = NULL;
44 map = (DexDataMap*) malloc(size);
46 if (map == NULL) {
50 map->count = 0;
51 map->max = maxCount;
52 map->offsets = (u4*) (map + 1);
53 map->types = (u2*) (map->offsets + maxCount);
55 return map;
61 void dexDataMapFree(DexDataMap* map) {
67 free(map);
71 * Add a new element to the map. The offset must be greater than the
74 void dexDataMapAdd(DexDataMap* map, u4 offset, u2 type) {
75 assert(map != NULL);
76 assert(map->count < map->max);
78 if ((map->count != 0) &&
79 (map->offsets[map->count - 1] >= offset)) {
80 ALOGE("Out-of-order data map offset: %#x then %#x",
81 map->offsets[map->count - 1], offset);
85 map->offsets[map->count] = offset;
86 map->types[map->count] = type;
87 map->count++;
94 int dexDataMapGet(DexDataMap* map, u4 offset) {
95 assert(map != NULL);
99 int max = map->count - 1;
100 u4* offsets = map->offsets;
112 return map->types[guessIdx];
121 * Verify that there is an entry in the map, mapping the given offset to
125 bool dexDataMapVerify(DexDataMap* map, u4 offset, u2 type) {
126 int found = dexDataMapGet(map, offset);
133 ALOGE("No data map entry found @ %#x; expected %x",
136 ALOGE("Unexpected data map entry @ %#x: expected %x, found %x",