Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

37
LINES

< > BotCompany Repo | #1018937 // Module RAM Sizes v3 [with transitive code size]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (19408L/140K).

!7

sclass ModuleInfo {
  S name;
  long code, data;
}

module ModuleRAMSizes extends DynObjectTable<ModuleInfo> {
  start {
    itemToMap = func(ModuleInfo m) -> Map {
      litorderedmap(
        Name := m.name,
        "Code (+submodules)" := str_toK_questionMarkIfZero(m.code),
        "Data" := str_toK_questionMarkIfZero(m.data),
        "Sum" := str_toK_questionMarkIfZero(m.code + m.data))
    };
    
    doEvery(dm_osStarting() ? 10.0 : 0.0, 60.0, r calcIt);
  }
  
  void calcIt {
    temp enter();
    new L<ModuleInfo> l;
    time "Calculate Module Sizes" {
      for (O mod : dm_listModules()) {
        long code = 0, data = 0;
        pcall-short { code = dm_moduleCodeSizeWithSubModules(mod); }
        pcall-short { data = dm_moduleSize(mod); }
        l.add(nu(ModuleInfo,
          name := dm_moduleName(mod),
          +code,
          +data));
      }
    }
    setData(sortedByCalculatedFieldDesc(func(ModuleInfo m) { m.code+m.data }, l));
  }
}

Author comment

Began life as a copy of #1018932

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1018937
Snippet name: Module RAM Sizes v3 [with transitive code size]
Eternal ID of this version: #1018937/4
Text MD5: bd4cd2777c9e80c476582a42f12f0f6f
Transpilation MD5: aa8b7bdb9b054e27a34120b40d9a09ad
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-16 20:59:13
Source code size: 1004 bytes / 37 lines
Pitched / IR pitched: No / No
Views / Downloads: 392 / 2726
Version history: 3 change(s)
Referenced in: #1018960 - JavaX Directory Sizes [Dyn Module]
#1022104 - Module RAM Sizes v3, debug version