Difference between revisions of "Memory Management (USE/fREe)"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
=Static Storage= | |||
The static memory storage is 322 entries big and located at 0x142A760C0 (v1.07).<br> | |||
The entries have a max content size of 32 bytes.<br> | |||
Due to this restriction the memory de/allocation in this storage is way faster than in the dynamic storage.<br> | |||
=Dynamic Storage= | |||
The dynamic storage is allocated with the function at 0x140361A40 (v1.07).<br> | |||
Two HLib entries will be added, one at the start and one at the end of the allocated memory.<br> | |||
After the first HLib entry a new fREe entry will be added and looks like this.<br> | |||
This entry has the previous entry pointer set to the first HLib entry and the next entry pointer set to the HLib entry at the end.<br> | |||
=Free Storage= | |||
To free storage the function 0x14049CDD0 (v1.07) is used.<br> | |||
=Allocate Storage= | |||
To allocate storage the function 0x14049CB40 (v1.07) is used.<br> | |||
=Storage entry= | =Storage entry= | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 23: | Line 40: | ||
|- | |- | ||
! Name !! Description | ! Name !! Description | ||
|- | |||
| HLib || Root storage entry type | |||
|- | |- | ||
| TASK || Used for task parameters | | TASK || Used for task parameters |
Revision as of 23:31, 10 January 2019
Static Storage
The static memory storage is 322 entries big and located at 0x142A760C0 (v1.07).
The entries have a max content size of 32 bytes.
Due to this restriction the memory de/allocation in this storage is way faster than in the dynamic storage.
Dynamic Storage
The dynamic storage is allocated with the function at 0x140361A40 (v1.07).
Two HLib entries will be added, one at the start and one at the end of the allocated memory.
After the first HLib entry a new fREe entry will be added and looks like this.
This entry has the previous entry pointer set to the first HLib entry and the next entry pointer set to the HLib entry at the end.
Free Storage
To free storage the function 0x14049CDD0 (v1.07) is used.
Allocate Storage
To allocate storage the function 0x14049CB40 (v1.07) is used.
Storage entry
Position | Length | Type | Description |
---|---|---|---|
0x00 | 0x04 | string | Memory type token |
0x04 | 0x04 | ? | Padding? |
0x08 | 0x08 | uint64_t | Content size |
0x10 | 0x08 | uint64_t* | Previous storage entry pointer |
0x18 | 0x08 | uint64_t* | Next storage entry pointer |
0x20 | 0x04 | string | USE/fREe token (determines if the space is being used) |
0x40 | Content size | ? | Storage data |
Storage tokens
Name | Description |
---|---|
HLib | Root storage entry type |
TASK | Used for task parameters |
MAI | Model data? |
SHDM | Model data |
SCNC | Scene stuff? |
WNDB | ? |
SHAD | Textures? |
WARN | Warning (uses textures?) |
WARP | (uses textures?) |
ITPH | (uses textures?) |
SNCT | (uses textures?) |
PAWN | Pawnshop? |
FLDD | Collision data |
ACPH | ? |
ACPD | ? |
DOME | Skybox dome? |
CVIX | Indexing? |
ADFS | ? |
CHID | Character ID? |
MODL | Model info? |
MAIX | Model info? |
PAKT | ? |
PAKa | ? |
PAKM | ? |
CLIP | ? |
WALL | ? |
WALC | ? |
FLAG | FLAG.BIN? |
HMDL | Model? |