Skip to content

Commit 0eec61e

Browse files
Chore: Extend string interning beyond 64-byte limit.
1 parent 364b534 commit 0eec61e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

compiler/src/modules/vm/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl HeapPool {
436436

437437
pub fn alloc(&mut self, obj: HeapObj) -> Result<Val, VmErr> {
438438
if let HeapObj::Str(ref s) = obj {
439-
if s.len() <= 64 {
439+
if s.len() <= 128 {
440440
if let Some(&idx) = self.strings.get(s) { return Ok(Val::heap(idx)); }
441441
}
442442
}
@@ -453,7 +453,7 @@ impl HeapPool {
453453
};
454454

455455
if let HeapObj::Str(s) = self.slots[idx as usize].obj.as_ref().unwrap() {
456-
if s.len() <= 64 { self.strings.insert(s.clone(), idx); }
456+
if s.len() <= 128 { self.strings.insert(s.clone(), idx); }
457457
}
458458

459459
self.live += 1;

0 commit comments

Comments
 (0)