Skip to content

Commit

Permalink
created subclass shapes in types module
Browse files Browse the repository at this point in the history
  • Loading branch information
cracked-machine committed Feb 9, 2024
1 parent bd5bef4 commit 79b36ae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
10 changes: 5 additions & 5 deletions doc/example/report.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
![memory map diagram](report.png)
|name|origin|size|remaining|collisions
|:-|:-|:-|:-|:-|
|<span style='color:mediumaquamarine'>kernel</span>|0x10|0x50|-0x10|{'rootfs': '0x50'}|
|<span style='color:chartreuse'>uboot</span>|0xD0|0x50|-0x10|{'uboot-scr': '0x110'}|
|<span style='color:skyblue'>rootfs</span>|0x50|0x30|0x10|{'kernel': '0x50'}|
|<span style='color:lightgreen'>dtb</span>|0x90|0x30|0x10|{}|
|<span style='color:grey'>uboot-scr</span>|0x110|0x30|0x50|{'uboot': '0x110'}|
|<span style='color:darkblue'>kernel</span>|0x10|0x50|-0x10|{'rootfs': '0x50'}|
|<span style='color:rebeccapurple'>uboot</span>|0xD0|0x50|-0x10|{'uboot-scr': '0x110'}|
|<span style='color:slategray'>rootfs</span>|0x50|0x30|0x10|{'kernel': '0x50'}|
|<span style='color:mediumaquamarine'>dtb</span>|0x90|0x30|0x10|{}|
|<span style='color:deepskyblue'>uboot-scr</span>|0x110|0x30|0x50|{'uboot': '0x110'}|
Binary file modified doc/example/report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions mm/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@


@typeguard.typechecked
class MemoryRegion:

class Region():
_remaining_colours: Dict = PIL.ImageColor.colormap.copy()
"""Copy of the PIL colour string map, we remove colours until all are gone.
Therefore avoiding random picking of duplicate colours"""
Expand Down Expand Up @@ -128,3 +127,13 @@ def calc_nearest_region(self, region_list: List['MemoryRegion']):
self.remain = hex(mm.diagram.MemoryMap.height - this_region_end)
elif self.collisons and not self.remain:
self.remain = hex(mm.diagram.MemoryMap.height - this_region_end)


@typeguard.typechecked
class MemoryRegion(Region):
pass


@typeguard.typechecked
class SkippableRegion(Region):
pass

0 comments on commit 79b36ae

Please sign in to comment.