ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.52 by root, Sun Oct 22 22:14:54 2006 UTC vs.
Revision 1.53 by root, Mon Oct 23 00:17:07 2006 UTC

118 return sv_2mortal (sv_bless (newRV_inc (req->self), gv_stashpv (klass, 1))); 118 return sv_2mortal (sv_bless (newRV_inc (req->self), gv_stashpv (klass, 1)));
119} 119}
120 120
121static aio_req SvAIO_REQ (SV *sv) 121static aio_req SvAIO_REQ (SV *sv)
122{ 122{
123 MAGIC *mg;
124
123 if (!sv_derived_from (sv, AIO_REQ_KLASS) || !SvROK (sv)) 125 if (!sv_derived_from (sv, AIO_REQ_KLASS) || !SvROK (sv))
124 croak ("object of class " AIO_REQ_KLASS " expected"); 126 croak ("object of class " AIO_REQ_KLASS " expected");
125 127
126 MAGIC *mg = mg_find (SvRV (sv), PERL_MAGIC_ext); 128 mg = mg_find (SvRV (sv), PERL_MAGIC_ext);
127 129
128 return mg ? (aio_req)mg->mg_ptr : 0; 130 return mg ? (aio_req)mg->mg_ptr : 0;
129} 131}
130 132
131static void aio_grp_feed (aio_req grp) 133static void aio_grp_feed (aio_req grp)
1277void 1279void
1278add (aio_req grp, ...) 1280add (aio_req grp, ...)
1279 PPCODE: 1281 PPCODE:
1280{ 1282{
1281 int i; 1283 int i;
1284 aio_req req;
1282 1285
1283 if (grp->fd == 2) 1286 if (grp->fd == 2)
1284 croak ("cannot add requests to IO::AIO::GRP after the group finished"); 1287 croak ("cannot add requests to IO::AIO::GRP after the group finished");
1285 1288
1286 for (i = 1; i < items; ++i ) 1289 for (i = 1; i < items; ++i )
1287 { 1290 {
1288 if (GIMME_V != G_VOID) 1291 if (GIMME_V != G_VOID)
1289 XPUSHs (sv_2mortal (newSVsv (ST (i)))); 1292 XPUSHs (sv_2mortal (newSVsv (ST (i))));
1290 1293
1291 aio_req req = SvAIO_REQ (ST (i)); 1294 req = SvAIO_REQ (ST (i));
1292 1295
1293 if (req) 1296 if (req)
1294 { 1297 {
1295 ++grp->length; 1298 ++grp->length;
1296 req->grp = grp; 1299 req->grp = grp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines