Add wee_alloc

This commit is contained in:
Andras Schmelczer 2025-07-03 16:41:33 +01:00
parent 9cb73680f8
commit da59156e07
3 changed files with 131 additions and 112 deletions

View file

@ -11,9 +11,16 @@
use core::str;
use cfg_if::cfg_if;
use wasm_bindgen::prelude::*;
use crate::{BuiltinTokenizer, CursorPosition, TextWithCursors, TextWithHistory};
cfg_if! {
if #[cfg(feature = "wee_alloc")] {
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc<'_> = wee_alloc::WeeAlloc::INIT;
}
}
/// WASM wrapper around `crate::reconcile` for merging text.
#[wasm_bindgen(js_name = reconcile)]