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

37
LINES

< > BotCompany Repo | #1022104 // Module RAM Sizes v3, debug version

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

Libraryless. Click here for Pure Java version (16505L/119K).

!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_toM_questionMarkIfZero(m.code),
        "Data" := str_toM_questionMarkIfZero(m.data),
        "Sum" := str_toM_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_debug(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 #1018937

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022104
Snippet name: Module RAM Sizes v3, debug version
Eternal ID of this version: #1022104/3
Text MD5: f19f533497c04665e0ae6a9a5ec49c3b
Transpilation MD5: b320d73fa963f92853449896e8edece3
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: 2019-03-07 22:16:48
Source code size: 1010 bytes / 37 lines
Pitched / IR pitched: No / No
Views / Downloads: 274 / 489
Version history: 2 change(s)
Referenced in: [show references]