MALLOC
This commit is contained in:
parent
298b287859
commit
bee39cb385
@ -209,6 +209,10 @@ X_API int PL_get_nchars(term_t l, size_t *lengthp, char **s, unsigned flags) {
|
||||
} else {
|
||||
out.enc = ENC_ISO_LATIN1;
|
||||
}
|
||||
|
||||
if (flags & BUF_MALLOC) {
|
||||
out.type |= YAP_STRING_MALLOC;
|
||||
}
|
||||
if (lengthp) {
|
||||
out.type |= YAP_STRING_NCHARS;
|
||||
out.max = *lengthp;
|
||||
@ -231,10 +235,7 @@ int PL_get_wchars(term_t l, size_t *lengthp, wchar_t **s, unsigned flags) {
|
||||
inp.type = cvtFlags(flags);
|
||||
out.type = YAP_STRING_WCHARS;
|
||||
if (flags & BUF_MALLOC) {
|
||||
out.type |= YAP_STRING_MALLOC;
|
||||
out.val.w = *s;
|
||||
} else {
|
||||
out.val.w = NULL;
|
||||
out.type |= YAP_STRING_MALLOC;
|
||||
}
|
||||
if (lengthp) {
|
||||
out.type |= YAP_STRING_NCHARS;
|
||||
|
Reference in New Issue
Block a user