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).

1  
!7
2  
3  
sclass ModuleInfo {
4  
  S name;
5  
  long code, data;
6  
}
7  
8  
module ModuleRAMSizes extends DynObjectTable<ModuleInfo> {
9  
  start {
10  
    itemToMap = func(ModuleInfo m) -> Map {
11  
      litorderedmap(
12  
        Name := m.name,
13  
        "Code (+submodules)" := str_toK_questionMarkIfZero(m.code),
14  
        "Data" := str_toK_questionMarkIfZero(m.data),
15  
        "Sum" := str_toK_questionMarkIfZero(m.code + m.data))
16  
    };
17  
    
18  
    doEvery(dm_osStarting() ? 10.0 : 0.0, 60.0, r calcIt);
19  
  }
20  
  
21  
  void calcIt {
22  
    temp enter();
23  
    new L<ModuleInfo> l;
24  
    time "Calculate Module Sizes" {
25  
      for (O mod : dm_listModules()) {
26  
        long code = 0, data = 0;
27  
        pcall-short { code = dm_moduleCodeSizeWithSubModules(mod); }
28  
        pcall-short { data = dm_moduleSize(mod); }
29  
        l.add(nu(ModuleInfo,
30  
          name := dm_moduleName(mod),
31  
          +code,
32  
          +data));
33  
      }
34  
    }
35  
    setData(sortedByCalculatedFieldDesc(func(ModuleInfo m) { m.code+m.data }, l));
36  
  }
37  
}

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: 391 / 2725
Version history: 3 change(s)
Referenced in: [show references]