| View previous topic :: View next topic |
| Author |
Message |
wayden Cheater
Reputation: 0
Joined: 09 Dec 2020 Posts: 27
|
Posted: Wed Jul 26, 2023 10:37 am Post subject: alloc less bytes |
|
|
Hi,
I wanted to know if it's possible to alloc less than 4096 bytes ?
i already tried
| Code: |
alloc(Mem_PointerStats,$300,GameAssembly.dll+C49B24)
|
but in memoryview 4096 are "accessible" like doing
| Code: |
alloc(Mem_PointerStats,$1000,GameAssembly.dll+C49B24)
|
and it's annoying since i don't need that much space
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4706
|
Posted: Wed Jul 26, 2023 10:59 am Post subject: |
|
|
No. Memory is organized into pages where each page is 0x1000 (4096) bytes. That's the lowest amount of memory that's possible to allocate in an address space.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Wed Jul 26, 2023 11:29 am Post subject: |
|
|
Additional fun fact, in windows you'd lose 64KB of virtual memory even if you just allocate 4KB
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
wayden Cheater
Reputation: 0
Joined: 09 Dec 2020 Posts: 27
|
Posted: Thu Jul 27, 2023 4:03 am Post subject: |
|
|
| Alright then im just gonna alloc a mainmem and define from here, thanks for the answers
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 97
Joined: 14 Jul 2007 Posts: 3327
|
Posted: Thu Jul 27, 2023 4:14 am Post subject: |
|
|
| Dark Byte wrote: | | Additional fun fact, in windows you'd lose 64KB of virtual memory even if you just allocate 4KB |
Whaaaat? lol
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4706
|
Posted: Thu Jul 27, 2023 12:03 pm Post subject: |
|
|
Not all 64 KiB is resident in physical memory. It's just that windows can only allocate memory on a 64 KiB boundary.
Ever notice how every VirtualAlloc always starts at an address ending in `0000`?
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
|