There is another problem with :outer. It does not let you create inner
functions dynamically. For example, I couldn't use it to compile next
ECMAScript code:
function outer() {
var i = 0;
return eval("function() { return i++; }");
}
Is it not possible to have an opcode tha
> One temporary workaround that I considered for this problem
> would be to have eval() use introspection on its caller to
> create a "wrapper sub" that duplicates the lexical environment of
> the caller, and then use that as the target of an :outer()
> flag when it's passed to imcc. For example,
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #48134]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=48134 >
Next code segfaults because callmethodcc does anothe
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #47704]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=47704 >
There is a memory leak with the STRING's. Next C code
> I traced the context creation and freeing (parrot -D80) but everything there
> matched up, so I finally narrowed things down to the affected lines in
> PMCProxy. Your initial instinct was good, so nice catch and good test case.
Thanks. That suppressed the leak in my first test cases. But I thin
I think that the leak is at C.
I tested it that way:
test.pmc
#include "parrot/parrot.h"
pmclass Test
dynpmc
group pjs_group
hll Pjs {
void set_integer_native(INTVAL ignore) {
int i;
for(i=0;i<1000;i++) {
Parrot_PCCINVOKE(INTERP, SELF,
We could maybe assume that the ordering is well defined between the
instances of a PMC class. But cmp needs to compare instances of
different PMC classes as well, for which a well defined ordering is
less probable.
I would not be surprised if in some dynamic language all of a==b, ab evaluate to fa
I agree. See
http://www.nntp.perl.org/group/perl.perl6.internals/2007/08/msg39889.html
[Sorry chromatic, forgot to send to the list]
> Did you happen to catch which PMC it is that's leaking?
I don't know which PMC, but the leak happens when you create a
PMCProxy with init_pmc.
> Also, is this with PIR or PBC or both?
Both.
> Do you have a short test case that Valgrind catches?
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #47572]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=47572 >
If you have defined an .HLL in your program, any pmc l
> -if (cc->from_ctx)
> -Parrot_free_context(interp, cc->from_ctx, 0);
> -Parrot_free_context(INTERP, from_ctx, 1);
I don't know much about this context stuff, so maybe I don't see
something, but how are those contexts freed after your patch?
Hello,
PJS (Parrot JavaScript) allows a number to be NaN. The result of
comparing an NaN to any value is false (thus all of NaN == NaN, NaN <
NaN, NaN > NaN, NaN <= NaN, NaN >= NaN evaluate to false).
There is only the vtable function C that a PMC can implement to
define ordering.
Parrot assumes
I don't think that the code is safe, but it does what it means :)
=item B
Halt and Catch Fire. Tries to crash parrot.
=cut
op hcf() {
int *a, i;
a = NULL;
i = *a;
goto OFFSET(i) ; /* in case your runtime is very forgiving. */
}
--
Mehmet
> What about a real_exception variant that accepts STRING*'s as arguments?
>
> On the other hand, as you said, there will be other functions which
> don't return control (functions that call real_exception etc.). But
> then char* is not the only problem, any malloced data can leak.
>
> void f() {
>
On 8/8/07, via RT chromatic <[EMAIL PROTECTED]> wrote:
> # New Ticket Created by chromatic
> # Please include the string: [perl #44499]
> # in the subject line of all future correspondence about this issue.
> # http://rt.perl.org/rt3/Ticket/Display.html?id=44499 >
>
>
> The string_from_cstring()
> Does the attached patch solve the problem?
>
Yes, it does. Thanks.
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #44247]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=44247 >
Calling a METHOD (declared in a pmclass) from PIR with :
On 6/2/07, chromatic <[EMAIL PROTECTED]> wrote:
On Friday 01 June 2007 16:29:08 Mehmet Yavuz Selim Soyturk wrote:
> After a suggestion of Bernhard at #parrot, I added a function named
> C to parrot:
>
> void * mem__sys_realloc_zeroed(void *from, size_t size, size_t
> ol
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #43105]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=43105 >
Function mmd_expand_y in src/mmd.c allocates new memor
It seems to work in general, but in some cases (especially when I
allocate too much memory) it causes me a segfault
or an error like: Trace/breakpoint trap (core dumped)
It was caused by some unitialized memory in src/mmd.c. rt #43105 solves it.
--
Mehmet
Hello,
I have two pmc classes PjsNumber and PjsBoolean, which define
bitwise_and like this:
PMC* bitwise_and(PMC* value, PMC* dest) {
FLOATVAL a, b;
if (! dest) {
dest = pmc_new(INTERP, dynpmc_PjsNumber);
} else if (dest->vtable->base_type != dynpmc_PjsNumber)
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #43002]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=43002 >
file: editor/kate_syntax.pl
* .ops files are now se
On 5/17/07, Klaas-Jan Stol <[EMAIL PROTECTED]> wrote:
On 5/17/07, Mehmet Yavuz Selim Soyturk <[EMAIL PROTECTED]> wrote:
> On 5/17/07, via RT Jerry Gay
<[EMAIL PROTECTED]> wrote:
> > # New Ticket Created by Jerry Gay
> > # Please include the string: [perl #42
On 5/17/07, via RT Jerry Gay <[EMAIL PROTECTED]> wrote:
# New Ticket Created by Jerry Gay
# Please include the string: [perl #42974]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=42974 >
it looks like the register alligato
The results of my first post in this thread were probably caused by
the fact that some files were not updated correctly (I am new to
revision control). Both Allison's and Alek's patches have in fact the
same effect.
But the problem that I stated in my second post and the proposed
solution are val
On 5/15/07, Alek Storm <[EMAIL PROTECTED]> wrote:
On 5/14/07, Mehmet Yavuz Selim Soyturk <[EMAIL PROTECTED] >
wrote:
> Should we not be able to use an object that implements 'invoke' as a
> method of another object? There is some strange behaviour when I try
> to.
On 5/10/07, via RT Alek Storm <[EMAIL PROTECTED]> wrote:
# New Ticket Created by "Alek Storm"
# Please include the string: [perl #42919]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=42919 >
Because PIR can't tell the diff
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #42790]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=42790 >
Next program makes a slurpy tailcall, and it causes a me
+format[sizeof(format - 1)] = '\0';
Shouldn't that be 'format[sizeof(format) - 1]' ?
--
Mehmet
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #42320]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=42320 >
The next program causes a memory leak for me.
.sub ma
Hello,
I'm implementing ECMAscript (javascript) which has prototype based
inheritance. An object is some sort of hash which has some properties.
An object can have a prototype, from which it inherits all of the
properties. And the objects prototype can also have a prototype, from
which the object
On 3/1/07, Mehmet Yavuz Selim Soyturk <[EMAIL PROTECTED]> wrote:
> Does the following patch fix it?
Sorry, I can't test if that patch helps. I was getting consistently a
segfault for that sort of tailcalls, but now it's gone. As far as I
can remember, I didn't chang
Does the following patch fix it?
Sorry, I can't test if that patch helps. I was getting consistently a
segfault for that sort of tailcalls, but now it's gone. As far as I
can remember, I didn't change anything to parrot (no updates, the same
default configuration). I only did a reboot. I don't k
# New Ticket Created by "Mehmet Yavuz Selim Soyturk"
# Please include the string: [perl #41642]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=41642 >
###
## file tail.pir
I have rewritten the grammar. There are some problems though.
- I don't know how to express thinks like: an identifier is
<[a..zA..Z_$]>*, but not a . Something like: rule identifier
{<[a..zA..Z_$]>*} seems not to allow identifiers that have
keywords as prefix.
- I couldn't make comments work.
-
Hi Mehmet,
you might have run into a Garbage-Collector bug. Try
parrot --no-gc main.pir 'x' 'identifier'
I had similar problems using PGE::P6Regex. '--no-gc' helped.
Regards,
Kiwi
The same problem.
I think that I now know the problem: the grammar is not complete. I
was thinking that pgc
js.pg in languages/ecmascript/src compiles just fine with pgc. But it
gives a "Null PMC access" error while using the compiled pir file. Is
it a pge bug?
$ cd languages/ecmascript/src
$ cat main.pir
.include 'errors.pasm'
.sub _main :main
.param pmc args
.local string source_code, rule_t
I am too planning to implement ECMAScript. I do not yet know how, I
have to experiment with parrot first.
38 matches
Mail list logo