ffi/unsafe: fix memory-management problem in recent change
Fixes a problem with bba223a9fe
.
This commit is contained in:
parent
c6e2843557
commit
dc19b8f4e2
|
@ -3720,7 +3720,7 @@ void free_cl_cif_queue_args(void *ignored, void *p)
|
||||||
void *data = ((closure_and_cif*)p)->data, *constant_result;
|
void *data = ((closure_and_cif*)p)->data, *constant_result;
|
||||||
void **q = (void **)data;
|
void **q = (void **)data;
|
||||||
data = q[0];
|
data = q[0];
|
||||||
constant_result = q[3];
|
constant_result = q[2];
|
||||||
free(q);
|
free(q);
|
||||||
if (constant_result) free(constant_result);
|
if (constant_result) free(constant_result);
|
||||||
#ifdef MZ_PRECISE_GC
|
#ifdef MZ_PRECISE_GC
|
||||||
|
@ -3781,8 +3781,8 @@ static Scheme_Object *foreign_ffi_callback(int argc, Scheme_Object *argv[])
|
||||||
GC_CAN_IGNORE void *callback_data;
|
GC_CAN_IGNORE void *callback_data;
|
||||||
# ifdef MZ_USE_MZRT
|
# ifdef MZ_USE_MZRT
|
||||||
int keep_queue = 0;
|
int keep_queue = 0;
|
||||||
void *constant_reply;
|
void *constant_reply = NULL;
|
||||||
int constant_reply_size;
|
int constant_reply_size = 0;
|
||||||
# endif /* MZ_USE_MZRT */
|
# endif /* MZ_USE_MZRT */
|
||||||
|
|
||||||
if (!SCHEME_PROCP(argv[0]))
|
if (!SCHEME_PROCP(argv[0]))
|
||||||
|
@ -3873,7 +3873,7 @@ static Scheme_Object *foreign_ffi_callback(int argc, Scheme_Object *argv[])
|
||||||
if (keep_queue) {
|
if (keep_queue) {
|
||||||
/* For ffi_queue_callback(), add a level of indirection in `data' to
|
/* For ffi_queue_callback(), add a level of indirection in `data' to
|
||||||
hold the place-specific `ffi_sync_queue'. Use
|
hold the place-specific `ffi_sync_queue'. Use
|
||||||
`free_cl_cif_data_args' to clean up this extra level. */
|
`free_cl_cif_queue_args' to clean up this extra level. */
|
||||||
GC_CAN_IGNORE void **tmp, *cr;
|
GC_CAN_IGNORE void **tmp, *cr;
|
||||||
if (constant_reply) {
|
if (constant_reply) {
|
||||||
cr = malloc(constant_reply_size);
|
cr = malloc(constant_reply_size);
|
||||||
|
|
|
@ -2926,7 +2926,7 @@ void free_cl_cif_queue_args(void *ignored, void *p)
|
||||||
void *data = ((closure_and_cif*)p)->data, *constant_result;
|
void *data = ((closure_and_cif*)p)->data, *constant_result;
|
||||||
void **q = (void **)data;
|
void **q = (void **)data;
|
||||||
data = q[0];
|
data = q[0];
|
||||||
constant_result = q[3];
|
constant_result = q[2];
|
||||||
free(q);
|
free(q);
|
||||||
if (constant_result) free(constant_result);
|
if (constant_result) free(constant_result);
|
||||||
#ifdef MZ_PRECISE_GC
|
#ifdef MZ_PRECISE_GC
|
||||||
|
@ -2985,8 +2985,8 @@ void free_cl_cif_queue_args(void *ignored, void *p)
|
||||||
GC_CAN_IGNORE void *callback_data;
|
GC_CAN_IGNORE void *callback_data;
|
||||||
@@IFDEF{MZ_USE_MZRT}{
|
@@IFDEF{MZ_USE_MZRT}{
|
||||||
int keep_queue = 0;
|
int keep_queue = 0;
|
||||||
void *constant_reply;
|
void *constant_reply = NULL;
|
||||||
int constant_reply_size;
|
int constant_reply_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SCHEME_PROCP(argv[0]))
|
if (!SCHEME_PROCP(argv[0]))
|
||||||
|
@ -3073,7 +3073,7 @@ void free_cl_cif_queue_args(void *ignored, void *p)
|
||||||
if (keep_queue) {
|
if (keep_queue) {
|
||||||
/* For ffi_queue_callback(), add a level of indirection in `data' to
|
/* For ffi_queue_callback(), add a level of indirection in `data' to
|
||||||
hold the place-specific `ffi_sync_queue'. Use
|
hold the place-specific `ffi_sync_queue'. Use
|
||||||
`free_cl_cif_data_args' to clean up this extra level. */
|
`free_cl_cif_queue_args' to clean up this extra level. */
|
||||||
GC_CAN_IGNORE void **tmp, *cr;
|
GC_CAN_IGNORE void **tmp, *cr;
|
||||||
if (constant_reply) {
|
if (constant_reply) {
|
||||||
cr = malloc(constant_reply_size);
|
cr = malloc(constant_reply_size);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user