[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/12] libpoke/pvm.jitter: Use more `pvm_make_string_nodup`
From: |
Mohammad-Reza Nabipoor |
Subject: |
[PATCH 04/12] libpoke/pvm.jitter: Use more `pvm_make_string_nodup` |
Date: |
Wed, 26 May 2021 02:51:07 +0430 |
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (sconc): Replace `pvm_make_string` with
`pvm_make_string_nodup`.
(ctos): Likewise.
(substr): Likewise.
---
ChangeLog | 7 +++++++
libpoke/pvm.jitter | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 15d858b0..8f04b03a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
+
+ * libpoke/pvm.jitter (sconc): Replace `pvm_make_string` with
+ `pvm_make_string_nodup`.
+ (ctos): Likewise.
+ (substr): Likewise.
+
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.h (pvm_make_string_nodup): New function declaration.
diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
index 079d1c18..2ead1a7c 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -3246,7 +3246,7 @@ instruction sconc ()
char *s = pvm_alloc (strlen (sa) + strlen (sb) + 1);
strcpy (s, sa);
strcat (s, sb);
- res = pvm_make_string (s);
+ res = pvm_make_string_nodup (s);
JITTER_PUSH_STACK (res);
#undef F
@@ -3887,7 +3887,7 @@ instruction ctos ()
str[0] = c;
str[1] = '\0';
- JITTER_PUSH_STACK (pvm_make_string (str));
+ JITTER_PUSH_STACK (pvm_make_string_nodup (str));
end
end
@@ -4195,7 +4195,7 @@ instruction substr () # ( STR ULONG ULONG -- STR ULONG
ULONG STR )
slen);
s[slen] = '\0';
- JITTER_PUSH_STACK (pvm_make_string (s));
+ JITTER_PUSH_STACK (pvm_make_string_nodup (s));
end
end
--
2.31.1
- [PATCH 00/12] Add format function, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 01/12] Update contact info of mnabipoor, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 03/12] libpoke: Fix `muls` insn to use `pvm_alloc`, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 02/12] doc/learn-poke-in-y-minutes.pk: Update, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 04/12] libpoke/pvm.jitter: Use more `pvm_make_string_nodup`,
Mohammad-Reza Nabipoor <=
- [PATCH 05/12] libpoke/pkl-rt.pk: Fix typo s/gigi/gibi/, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 06/12] libpoke: Fix trivial errors, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 07/12] libpoke: Add `__pkl_unsafe_string_set` builtin, Mohammad-Reza Nabipoor, 2021/05/25