Skip to content

Instantly share code, notes, and snippets.

View bacek's full-sized avatar

Vasily Chekalkin bacek

View GitHub Profile
use std::env;
use std::fs::File;
use std::io::prelude::Read;
use std::io;
#[derive(Copy, Clone)]
enum CheckResult {
Zero = 0,
Empty = 1,
NotZero = 2,
colorscheme wombat
set ai
set et
set ts=2
set sts=2
set sw=2
set guioptions-=T
set guioptions-=m
@bacek
bacek / gist:fd8a4e141e124b51c75802a77ceac02d
Created September 6, 2017 23:05
systemctl show NetworkManager
[root@ocp-node-3 ~]# systemctl show NetworkManager
Restart=no
NotifyAccess=none
RestartUSec=100ms
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0
WatchdogTimestampMonotonic=0
StartLimitInterval=10000000
StartLimitBurst=5
@bacek
bacek / gist:2305904
Created April 4, 2012 21:40
Rakudo's patch for unmerge_context Parrot's branch.
bacek@fireball:~/src/rakudo$ cat unmerge.patch
diff --git a/src/binder/bind.c b/src/binder/bind.c
index 05842fb..1e19a64 100644
--- a/src/binder/bind.c
+++ b/src/binder/bind.c
@@ -6,7 +6,7 @@ Copyright (C) 2009-2011, The Perl Foundation.
#define PARROT_IN_EXTENSION
#include "parrot/parrot.h"
#include "parrot/extend.h"
-#include "pmc_callcontext.h"
@bacek
bacek / gist:2299766
Created April 4, 2012 08:47
Patch for nqp for unmerge_context branch
~/src/nqp (master) $ cat m.patch
diff --git a/src/6model/knowhow_bootstrapper.c b/src/6model/knowhow_bootstrapper.c
index 735b821..60f555d 100644
--- a/src/6model/knowhow_bootstrapper.c
+++ b/src/6model/knowhow_bootstrapper.c
@@ -289,7 +289,7 @@ PMC * SixModelObject_setup_knowhow_attribute(PARROT_INTERP, PMC *sc, PMC *knowho
meth = STABLE(knowhow)->find_method(interp, knowhow,
Parrot_str_new_constant(interp, "new_type"), NO_HINT);
old_ctx = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
- cappy = Parrot_pmc_new(interp, enum_class_CallContext);
@bacek
bacek / gist:2288708
Created April 3, 2012 01:52
unmerge_context test results
Test Summary Report
-------------------
t/op/calling.t (Wstat: 512 Tests: 104 Failed: 2)
Failed tests: 55-56
Non-zero exit status: 2
t/op/cc_params.t (Wstat: 0 Tests: 21 Failed: 5)
Failed tests: 1, 3, 8, 13, 16
t/pmc/callcontext.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: Bad plan. You planned 65 tests but ran 0.
@bacek
bacek / gist:1985777
Created March 6, 2012 11:25
nqp makefile change proposal
diff --git a/src/ops/nqp.ops b/src/ops/nqp.ops
index a6ef86c..e50d8fb 100755
--- a/src/ops/nqp.ops
+++ b/src/ops/nqp.ops
@@ -6,12 +6,12 @@ BEGIN_OPS_PREAMBLE
#include "parrot/dynext.h"
/* 6modely includes. */
-#include "../6model/sixmodelobject.h"
-#include "../6model/repr_registry.h"
@bacek
bacek / gist:1971209
Created March 4, 2012 08:03
Patch for rakudo to work on modern parrot
diff --git a/src/binder/multidispatch.c b/src/binder/multidispatch.c
index b796a35..ee915c4 100644
--- a/src/binder/multidispatch.c
+++ b/src/binder/multidispatch.c
@@ -571,7 +571,7 @@ static PMC* find_best_candidate(PARROT_INTERP, Rakudo_md_candidate_info **candid
opcode_t *where;
INTVAL bind_check_result;
Rakudo_Code *code_obj = (Rakudo_Code *)PMC_data(possibles[i]->sub);
- cthunk = VTABLE_getprop(interp, code_obj->_do,
+ cthunk = Parrot_pmc_getprop(interp, code_obj->_do,
@bacek
bacek / gist:1873726
Created February 21, 2012 04:42
Rakudo's patch for cont_reuse Parrot's branch.
diff --git a/src/binder/multidispatch.c b/src/binder/multidispatch.c
index b1be465..4aa085e 100644
--- a/src/binder/multidispatch.c
+++ b/src/binder/multidispatch.c
@@ -545,7 +545,6 @@ static PMC* find_best_candidate(PARROT_INTERP, Rakudo_md_candidate_info **candid
INTVAL i;
for (i = 0; i < possibles_count; i++) {
- interp->current_cont = (PMC *)NEED_CONTINUATION;
Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), NULL);
In master:
....
019f compreg P2, "PASM" P2=PMCNULL
01a2 set_args PC5 (2), P2, S0 PC5=FixedIntegerArray=PMC(0x91c3aec) P2=IMCCompiler=PMC(0x91c38d0) S0="t/pmc/sub_1.pasm"
01a6 tailcallmethod P2, "compile_file" P2=IMCCompiler=PMC(0x91c38d0)
010c get_results PC2 (1), P0 PC2=FixedIntegerArray=PMC(0x91c39fc) P0=PMCNULL
010f if_null S2, 14 S2=""
011d set_args PC3 (2), P0, "init" PC3=FixedIntegerArray=PMC(0x91c3a4c) P0=PackfileView=PMC(0x9246a1c)
0121 callmethodcc P0, "subs_by_tag" P0=PackfileView=PMC(0x9246a1c)
0124 get_results PC2 (1), P2 PC2=FixedIntegerArray=PMC(0x91c39fc) P2=Integer=PMC(0x9215c94: 1)