取消注册M3型号

问题描述 投票:1回答:1

当前从注册表中注销M3模型的首选方式是什么?

在我的项目中,我正在使用Rascal分析大约100个大型Java程序,并且我的JVM内存不足。我在较旧版本的注册表中找到了unregisterProject方法,并尝试使用此代码,但我认为它无法正常工作。

public void unregisterProject(loc project, M3 model) {
    rel[str scheme, loc name, loc src] perScheme 
      = {<name.scheme, name, src> | <name, src> <- model.declarations};

    for (str scheme <- perScheme<scheme>) {
           unregisterLocations(scheme, project.authority);
    }
}

我当前的解决方法是在问题上投入大量内存。

memory rascal
1个回答
0
投票

此代码可能会更好。它首先收集所有已注册的方案和权限对(并删除重复的对),然后调用unregisterLocations函数要求其余的唯一对。

public void unregisterProject(loc project, M3 model) {
    schemesAndAuthorities 
      = {<name.scheme, name.authority> | <name, src> <- model.declarations};

    for (<scheme, authority> <- schemesAndAuthorities) {
           unregisterLocations(scheme, authority);
    }
}

您会尝试吗?如果可行,我们可以通过一些测试将其添加回标准库。先前的代码基于不同的位置注册方式,因此取消注册无效。

© www.soinside.com 2019 - 2024. All rights reserved.