(self)
| 476 | |
| 477 | @memoize |
| 478 | def get_memories(self): |
| 479 | section = self.get_section(SecType.MEMORY) |
| 480 | if not section: |
| 481 | return [] |
| 482 | memories = [] |
| 483 | self.seek(section.offset) |
| 484 | num_memories = self.read_uleb() |
| 485 | for _ in range(num_memories): |
| 486 | limits = self.read_limits() |
| 487 | memories.append(Memory(limits)) |
| 488 | |
| 489 | return memories |
| 490 | |
| 491 | def get_section(self, section_code): |
| 492 | return next((s for s in self.sections() if s.type == section_code), None) |