TheDauthi has asked for the wisdom of the Perl Monks concerning the following question:
Where ExpensiveGetString is approximately equal toAV* GetTable() PREINIT: AV *array; int max_rows, max_cols, row, col; char *message; SV *message_sv; CODE: max_rows = 10; max_cols = 5; array = (AV*) sv_2mortal((SV*) newAV()); for( row = 0; row < max_rows; row++) { for( col = 0; col < max_cols; col++) { message_sv = newSV(83); message = SvPV_nolen(message_sv); ExpensiveGetString(row, col, message, 83); av_push(array, message_sv); } } RETVAL = array; OUTPUT: RETVAL
which is exactly what I'm using to test it. I get an array of undefs back, which tells me that I'm missing something.strcpy(message, "12345678901234567890123456789012345678901234567890123 +456789012345678901234567890123456789012345678901234567890123456789012 +\0");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XS efficient copy
by Anonymous Monk on Apr 06, 2006 at 19:54 UTC | |
by creamygoodness (Curate) on Apr 06, 2006 at 20:11 UTC | |
by TheDauthi (Sexton) on Apr 06, 2006 at 22:51 UTC | |
by creamygoodness (Curate) on Apr 07, 2006 at 18:19 UTC | |
by tye (Sage) on Apr 06, 2006 at 22:50 UTC | |
by creamygoodness (Curate) on Apr 07, 2006 at 03:31 UTC | |
by tye (Sage) on Apr 07, 2006 at 06:46 UTC | |
| |
by TheDauthi (Sexton) on Apr 07, 2006 at 20:36 UTC | |
|