malloc
This commit is contained in:
parent
353690cc59
commit
56f47acc49
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#define CSTACK_DEFNS
|
#define CSTACK_DEFNS
|
||||||
#include "rconfig.h"
|
#include "rconfig.h"
|
||||||
#if HAVE_R_H || !defined(_YAP_NOT_INSTALLED_)
|
#if HAVE_R_H || !defined(_YAP_NOT_INSTALLED_)
|
||||||
@ -480,7 +479,7 @@ static int term_to_S_el(term_t t, int objtype, size_t index, SEXP ans) {
|
|||||||
switch (objtype) {
|
switch (objtype) {
|
||||||
case PL_R_CHARS:
|
case PL_R_CHARS:
|
||||||
case PL_R_PLUS: {
|
case PL_R_PLUS: {
|
||||||
char *s;
|
char *s = NULL;
|
||||||
|
|
||||||
if (PL_get_chars(t, &s, CVT_ATOM | CVT_STRING | CVT_LIST | BUF_DISCARDABLE |
|
if (PL_get_chars(t, &s, CVT_ATOM | CVT_STRING | CVT_LIST | BUF_DISCARDABLE |
|
||||||
REP_UTF8)) {
|
REP_UTF8)) {
|
||||||
@ -782,7 +781,7 @@ static SEXP list_to_sexp(term_t t, int objtype) {
|
|||||||
|
|
||||||
static int slot_to_sexp(term_t t, SEXP *ansP) {
|
static int slot_to_sexp(term_t t, SEXP *ansP) {
|
||||||
term_t tslot = PL_new_term_ref();
|
term_t tslot = PL_new_term_ref();
|
||||||
char *s;
|
char *s = NULL;
|
||||||
SEXP tmp_R, name_R;
|
SEXP tmp_R, name_R;
|
||||||
int nprotect = 0;
|
int nprotect = 0;
|
||||||
|
|
||||||
@ -814,7 +813,7 @@ static int slot_to_sexp(term_t t, SEXP *ansP) {
|
|||||||
|
|
||||||
static int set_slot_to_sexp(term_t t, SEXP sexp) {
|
static int set_slot_to_sexp(term_t t, SEXP sexp) {
|
||||||
term_t tslot = PL_new_term_ref();
|
term_t tslot = PL_new_term_ref();
|
||||||
char *s;
|
char *s = NULL;
|
||||||
SEXP tmp_R, name_R;
|
SEXP tmp_R, name_R;
|
||||||
int nprotect = 0;
|
int nprotect = 0;
|
||||||
|
|
||||||
@ -845,7 +844,7 @@ static int set_slot_to_sexp(term_t t, SEXP sexp) {
|
|||||||
|
|
||||||
static int listEl_to_sexp(term_t t, SEXP *ansP) {
|
static int listEl_to_sexp(term_t t, SEXP *ansP) {
|
||||||
term_t tslot = PL_new_term_ref();
|
term_t tslot = PL_new_term_ref();
|
||||||
char *s;
|
char *s = NULL;
|
||||||
SEXP tmp_R;
|
SEXP tmp_R;
|
||||||
int nprotect = 0;
|
int nprotect = 0;
|
||||||
|
|
||||||
@ -876,7 +875,7 @@ static SEXP pl_to_func(term_t t, bool eval) {
|
|||||||
term_t a1 = PL_new_term_ref(), a;
|
term_t a1 = PL_new_term_ref(), a;
|
||||||
int i, ierror;
|
int i, ierror;
|
||||||
SEXP c_R, call_R, res_R;
|
SEXP c_R, call_R, res_R;
|
||||||
char *sf;
|
char *sf = NULL;
|
||||||
int nprotect = 0;
|
int nprotect = 0;
|
||||||
|
|
||||||
if (!PL_get_name_arity(t, &name, &arity)) {
|
if (!PL_get_name_arity(t, &name, &arity)) {
|
||||||
@ -2028,7 +2027,7 @@ static foreign_t send_c_vector(term_t tvec, term_t tout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static foreign_t rexpr_to_pl_term(term_t in, term_t out) {
|
static foreign_t rexpr_to_pl_term(term_t in, term_t out) {
|
||||||
char *s;
|
char *s = NULL;
|
||||||
|
|
||||||
if (PL_get_chars(in, &s, CVT_ALL | BUF_MALLOC | REP_UTF8)) {
|
if (PL_get_chars(in, &s, CVT_ALL | BUF_MALLOC | REP_UTF8)) {
|
||||||
SEXP sexp;
|
SEXP sexp;
|
||||||
@ -2050,7 +2049,7 @@ static foreign_t rexpr_to_pl_term(term_t in, term_t out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static foreign_t robj_to_pl_term(term_t name, term_t out) {
|
static foreign_t robj_to_pl_term(term_t name, term_t out) {
|
||||||
char *plname;
|
char *plname = NULL;
|
||||||
int nprotect = 0;
|
int nprotect = 0;
|
||||||
|
|
||||||
if (PL_get_chars(name, &plname, CVT_ALL | BUF_DISCARDABLE | REP_UTF8)) {
|
if (PL_get_chars(name, &plname, CVT_ALL | BUF_DISCARDABLE | REP_UTF8)) {
|
||||||
@ -2141,7 +2140,7 @@ static foreign_t execute_R(term_t rvar, term_t value) {
|
|||||||
|
|
||||||
static foreign_t is_R_variable(term_t t) {
|
static foreign_t is_R_variable(term_t t) {
|
||||||
SEXP name, o;
|
SEXP name, o;
|
||||||
char *s;
|
char *s = NULL;
|
||||||
int nprotect = 0;
|
int nprotect = 0;
|
||||||
|
|
||||||
/* is this variable defined in R?. */
|
/* is this variable defined in R?. */
|
||||||
|
Reference in New Issue
Block a user