Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

#define version obj.version is a kind of generic thing

7 views
Skip to first unread message

Arthur Bergman

unread,
Oct 27, 2003, 6:42:52 AM10/27/03
to perl6-i...@perl.org
Hi,

Upgraded parrot today and ran into some snags with in my own
perl5lv.pmc that includes perl.h

The error was

/Users/sky/Documents/Projects/ponie/perl/proto.h:778: parse error
before '.' token

That line is

PERL_CALLCONV void Perl_utilize(pTHX_ int aver, I32 floor, OP* version,
OP* idop, OP* arg);

Which convienently gets converted to

void Perl_utilize ( int aver , I32 floor , OP * obj . version , OP *
idop , OP * arg ) ;

because of

include/parrot/pobj.h:# define version obj.version

So I am wondering about the status of how to write my own pmc, should
it not include parrot/parrot.h ? If it should, perhaps it would be good
if all parrot things are prefixed as suck, at least when they have very
generic meanings?

Arthur

Leopold Toetsch

unread,
Oct 27, 2003, 9:10:36 AM10/27/03
to Arthur Bergman, perl6-i...@perl.org
Arthur Bergman <s...@nanisky.com> wrote:

> include/parrot/pobj.h:# define version obj.version

Sorry for that :) We can AFAIK toss the version part of a PObj. Its
almost unused and hardly needed. It could be renamed too inside parrot.

It should be out of the way, if you "#define DISABLE_GC_DEBUG 1" before
including parrot.h

> Arthur

leo

Arthur Bergman

unread,
Oct 27, 2003, 9:15:58 AM10/27/03
to l...@toetsch.at, perl6-i...@perl.org

For the time being I just did

#define version version

:)

Arthur

Leopold Toetsch

unread,
Oct 27, 2003, 10:15:42 AM10/27/03
to Arthur Bergman, perl6-i...@perl.org
Arthur Bergman <s...@nanisky.com> wrote:

> For the time being I just did

> #define version version

And I have checked in s/version/pobj_version/g :)

> Arthur


leo

Steve Fink

unread,
Oct 27, 2003, 11:55:49 PM10/27/03
to Leopold Toetsch, Arthur Bergman, perl6-i...@perl.org
On Oct-27, Leopold Toetsch wrote:
> Arthur Bergman <s...@nanisky.com> wrote:
>
> > include/parrot/pobj.h:# define version obj.version
>
> Sorry for that :) We can AFAIK toss the version part of a PObj. Its
> almost unused and hardly needed. It could be renamed too inside parrot.

I'm the guilty one who added the version field (though back then, it
was added to a Buffer object, IIRC). I found it very helpful in
debugging GC problems -- I would have a problem where memory was being
stomped on, and trace it back to a prematurely freed and reused
header. But in order to figure out what was going on, I needed to
trace it back to the point of allocation of the header, but headers
get reused so frequently that setting a conditional breakpoint on the
address of the header was useless. So I added in the version number to
provide something to set a breakpoint on.

It is very possible that this is no longer useful; I haven't been
working on stuff where I have needed it for long enough that the code
has mutated significantly. Is it still useful? If not, then go ahead
and rip it out.

Leopold Toetsch

unread,
Oct 28, 2003, 1:36:27 AM10/28/03
to Steve Fink, perl6-i...@perl.org
Steve Fink <st...@fink.com> wrote:
> ... Is it still useful? If not, then go ahead
> and rip it out.

Its still useful for the reason you described. Its renamed now to
pobj_version.

leo

0 new messages