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 that
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, the
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48134
Next code segfaults because callmethodcc does another method call
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=47704
There is a memory leak with the STRING's. Next C code consumes more
I think that the leak is at CParrot_PCCINVOKE.
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;i1000;i++) {
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
and ab
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=47572
If you have defined an .HLL in your program, any pmc leaks. I could
[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?
I
I agree. See
http://www.nntp.perl.org/group/perl.perl6.internals/2007/08/msg39889.html
-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 Ccmp 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 Bhcf
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
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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44499
The string_from_cstring()
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() {
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44247
Calling a METHOD (declared in a pmclass) from PIR with :flat modifier
Does the attached patch solve the problem?
Yes, it does. Thanks.
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
Cmem_sys_realloc_zeroed to parrot:
void * mem__sys_realloc_zeroed(void *from, size_t size, size_t
old_size
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) {
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
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43105
Function mmd_expand_y in src/mmd.c allocates new memory for the mmd
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43002
file: editor/kate_syntax.pl
* .ops files are now searched
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 #42974]
# in the subject line of all future
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
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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42974
it looks like the register
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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42919
Because PIR can't tell the
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42790
Next program makes a slurpy tailcall, and it causes a memory leak
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42320
The next program causes a memory leak for me.
.sub main :main
loop
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
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
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 change anything to parrot (no updates
# 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.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41642
###
## file tail.pir:
.namespace
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 keyword. Something like: rule identifier
{!keyword[a..zA..Z_$]*} seems not to allow identifiers that have
keywords as prefix.
- I couldn't make
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
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,
I am too planning to implement ECMAScript. I do not yet know how, I
have to experiment with parrot first.
35 matches
Mail list logo