mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Squeeze more performance out of memory manager
This commit is contained in:
parent
63065cdd70
commit
76cea6c687
4 changed files with 18 additions and 29 deletions
|
@ -74,10 +74,9 @@ int __mprotect(char *addr, size_t size, int prot) {
|
|||
__maps_unlock();
|
||||
return edeadlk();
|
||||
}
|
||||
struct Map *map, *ceil, *floor;
|
||||
struct Map *map, *floor;
|
||||
floor = __maps_floor(addr);
|
||||
ceil = __maps_ceil(addr + size);
|
||||
for (map = floor; map && map != ceil; map = __maps_next(map)) {
|
||||
for (map = floor; map && map->addr <= addr + size; map = __maps_next(map)) {
|
||||
char *map_addr = map->addr;
|
||||
size_t map_size = map->size;
|
||||
char *beg = MAX(addr, map_addr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue