Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby
All Projects
Ruby
Overview
Activity
Roadmap
Issues
Repository
Like
Download (365 Bytes)
Bug #12670
» segv.c
wanabe (_ wanabe)
, 05/22/2017 05:03 AM
#include
"ruby.h"
void
destroy_pixel
(
char
*
ptr
)
{
xfree
(
ptr
);
}
VALUE
get_pixels
(
VALUE
self
)
{
int
i
,
n
=
FIX2INT
(
self
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
char
*
pixel
=
ALLOC
(
char
);
Data_Wrap_Struct
(
rb_cData
,
NULL
,
dummy_free
,
destroy_pixel
);
}
return
Qnil
;
}
void
Init_segv
(
void
)
{
rb_define_method
(
rb_cInteger
,
"get_pixels"
,
get_pixels
,
0
);
}
« Previous
1
…
5
6
7
Next »
(7-7/7)
Loading...