Update: 更新板卡
This commit is contained in:
@@ -989,5 +989,34 @@ export const do_while = {
|
||||
}
|
||||
};
|
||||
|
||||
export const garbage_collection = {
|
||||
init: function () {
|
||||
this.setColour(LOOPS_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_OP_GARBAGE_COLLECT);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const get_mem_alloc = {
|
||||
init: function () {
|
||||
this.setColour(LOOPS_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_GET_MEM_ALLOC);
|
||||
this.setOutput(true)
|
||||
}
|
||||
};
|
||||
|
||||
export const get_mem_free = {
|
||||
init: function () {
|
||||
this.setColour(LOOPS_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_GET_MEM_FREE);
|
||||
this.setOutput(true)
|
||||
}
|
||||
};
|
||||
|
||||
// export const base_type = controls_type;
|
||||
// export const controls_TypeLists = controls_typeLists;
|
||||
@@ -252,5 +252,24 @@ export const controls_repeat_ext = function (a, generator) {
|
||||
return 'for _my_variable in range(' + times + '):\n' + d;
|
||||
}
|
||||
|
||||
|
||||
export const garbage_collection = function (_, generator) {
|
||||
generator.definitions_['import_gc'] = 'import gc';
|
||||
var code = 'gc.collect()\n'
|
||||
return code;
|
||||
}
|
||||
|
||||
export const get_mem_alloc = function (_, generator) {
|
||||
generator.definitions_['import_gc'] = 'import gc';
|
||||
var code = 'gc.mem_alloc()\n';
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
}
|
||||
|
||||
export const get_mem_free = function (_, generator) {
|
||||
generator.definitions_['import_gc'] = 'import gc';
|
||||
var code = 'gc.mem_free()\n';
|
||||
return [code, generator.ORDER_ATOMIC]
|
||||
}
|
||||
|
||||
// ok
|
||||
export const controls_repeat = controls_repeat_ext;
|
||||
Reference in New Issue
Block a user