Ticket #659 (new feature)

Opened 5 years ago

Last modified 4 years ago

CONST_STRING in a dynop

Reported by: jonathan Owned by:
Priority: minor Milestone:
Component: core Version: 1.1.0
Severity: low Keywords:
Cc: jkeenan Language:
Patch status: Platform: all

Description

Hi,

CONST_STRING works nicely in dynpmcs, but today I tried to use it in a dynop and it doesn't seem to be available there (just says its an undefined symbol and fails to link). While my op isn't an especially performance critical one (I'm writing an op 'cus I need to get at guts more than for performance), so using string_from_literal isn't so bad, it would be nice to have been able to use CONST_STRING in there (and others may have an op that will run lots and not creating more short-lived GC-able objects is always a good thing).

Thanks,

Jonathan

Change History

Changed 4 years ago by jkeenan

  • cc jkeenan added

Jonathan:

Could you provide an update on the status of this issue?

Thank you very much.

kid51

Changed 4 years ago by plobsing

CONST_STRING() in dynpmcs does not work the same as in core parrot. It operates as an ordinary C macro. Parrot_str_new_constant() or string_from_literal() is the best any dynamically loaded extension can do.

If you'd like for opsc to generate this macro as well, that should be easy to implement.

Note: See TracTickets for help on using tickets.