balloc 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.MD +157 -334
- package/docs/API /342/200/224 balloc.en.md" +478 -1217
- package/docs/MIGRATION /342/200/224 balloc.en.md" +208 -0
- package/package.json +2 -44
- package/src/README.MD +0 -0
- package/src/en/balloc.cjs +510 -960
- package/src/en/balloc.js +1 -1
- package/src/en/balloc.mjs +551 -1099
- package/types/README.MD +0 -0
- package/types/en/balloc.d.mts +275 -583
- package/README.ar.md +0 -439
- package/README.en.md +0 -467
- package/README.es.md +0 -439
- package/README.jp.md +0 -438
- package/README.pt.md +0 -462
- package/README.zh.md +0 -438
- package/docs/API /342/200/224 balloc.ar.md" +0 -1509
- package/docs/API /342/200/224 balloc.es.md" +0 -1325
- package/docs/API /342/200/224 balloc.jp.md" +0 -1264
- package/docs/API /342/200/224 balloc.pt.md" +0 -1395
- package/docs/API /342/200/224 balloc.zh.md" +0 -1324
- package/src/ar/balloc.cjs +0 -1303
- package/src/ar/balloc.js +0 -2
- package/src/ar/balloc.mjs +0 -1591
- package/src/es/balloc.cjs +0 -1320
- package/src/es/balloc.js +0 -2
- package/src/es/balloc.mjs +0 -1608
- package/src/jp/balloc.cjs +0 -1260
- package/src/jp/balloc.js +0 -2
- package/src/jp/balloc.mjs +0 -1548
- package/src/pt/balloc.cjs +0 -1326
- package/src/pt/balloc.js +0 -2
- package/src/pt/balloc.mjs +0 -1619
- package/src/zh/balloc.cjs +0 -1205
- package/src/zh/balloc.js +0 -2
- package/src/zh/balloc.mjs +0 -1493
- package/types/ar/balloc.d.mts +0 -793
- package/types/es/balloc.d.mts +0 -810
- package/types/jp/balloc.d.mts +0 -750
- package/types/pt/balloc.d.mts +0 -818
- package/types/zh/balloc.d.mts +0 -695
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.0] - 2026-11-29
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Independent memory blocks backed by their own `ArrayBuffer` instances.
|
|
12
|
+
- Numeric block handles managed by an allocator-local registry.
|
|
13
|
+
- Per-block capacity and occupancy tracking.
|
|
14
|
+
- `byteSize()` for querying a block's physical size in bytes.
|
|
15
|
+
- `fillAll()` for filling a block and setting its occupancy to full capacity.
|
|
16
|
+
- `shrink()` for reducing a block's capacity to fit its occupied elements.
|
|
17
|
+
- `loadData(adapter)` for synchronous ingestion through the `FormatAdapter` contract.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- Replaced the shared-heap architecture with independently allocated typed-array blocks.
|
|
21
|
+
- Changed the constructor to `new Balloc(maxByteSize, defaultBucketType)`. The first argument is now the maximum permitted size of an individual allocation; it no longer preallocates a shared heap.
|
|
22
|
+
- Changed `alloc(size, bucketType)` to interpret `size` in bytes. The requested size must be aligned to the selected element width and remain below `maxByteSize`; capacity is no longer rounded to a power of two.
|
|
23
|
+
- Kept explicit `realloc(handler, newSize)` sizes in elements. When omitted, the new capacity is twice the current element capacity, subject to the allocation limit.
|
|
24
|
+
- Changed `fill()` to preserve the greater of the previous occupancy and the requested range end. Use `fillAll()` when the entire block must become occupied.
|
|
25
|
+
- Changed `copy()` to return the destination block's typed-array view rather than a `Uint8Array` view over a shared heap.
|
|
26
|
+
- Defined `clone()` to copy the complete typed array, including unoccupied slots, while preserving occupancy and bucket type.
|
|
27
|
+
- Changed `swap()` to exchange the block objects associated with the supplied handles.
|
|
28
|
+
- Reworked `dump()` and `load()` around the version 2 CBOR envelope, which records bucket type, capacity, occupancy, and the occupied typed-array payload.
|
|
29
|
+
|
|
30
|
+
### Removed
|
|
31
|
+
- Shared `dataBus` and `controlBus` storage, block headers, and heap-pointer-based allocation.
|
|
32
|
+
- Shared-heap bump allocation, region recycling, and compaction.
|
|
33
|
+
- `gc()`, `recycleCount()`, `recycleBytes`, `allocatedBytes`, `unallocatedBytes`, and `fragmentationRatio`.
|
|
34
|
+
- Public reliance on internal heap, pointer, and header-management structures.
|
|
35
|
+
|
|
36
|
+
### Breaking changes
|
|
37
|
+
- Version 2.0.0 is not backward-compatible with 1.x and is not a drop-in replacement.
|
|
38
|
+
- Applications must convert `alloc()` arguments from element counts to byte sizes and review constructor arguments, capacity assumptions, and block lifecycle handling.
|
|
39
|
+
- Applications that use removed heap-management APIs or internal storage structures must be adapted to the block-oriented API.
|
|
40
|
+
- Version 1.x serialized data is not directly compatible with the version 2 CBOR format. Decode legacy data with the corresponding 1.x release and re-encode it using 2.0.0.
|
|
41
|
+
- See the [migration guide](docs/MIGRATION%20%E2%80%94%20balloc.en.md) for the required porting steps.
|
|
42
|
+
|
|
8
43
|
## [1.4.0] - 2026-11-23
|
|
9
44
|
|
|
10
45
|
### Added
|