Methods Summary |
---|
public static PlatformAddress | alloc(int size)Allocates a contiguous block of OS heap memory.
int osAddress = PlatformAddress.osMemory.malloc(size);
PlatformAddress newMemory = on(osAddress, size);
PlatformAddress.memorySpy.alloc(newMemory);
return newMemory;
|
public static PlatformAddress | alloc(int size, byte init)Allocates a contiguous block of OS heap memory and initializes it to
a given value.
int osAddress = PlatformAddress.osMemory.malloc(size);
PlatformAddress.osMemory.memset(osAddress, init, size);
PlatformAddress newMemory = on(osAddress, size);
PlatformAddress.memorySpy.alloc(newMemory);
return newMemory;
|
public static PlatformAddress | allocMap(int fd, long start, long size, int mode)
int osAddress = PlatformAddress.osMemory.mmap(fd, start, size, mode);
PlatformAddress newMemory = mapOn(osAddress, size);
PlatformAddress.memorySpy.alloc(newMemory);
return newMemory;
|
public static MappedPlatformAddress | mapOn(int value, long size)
MappedPlatformAddress addr = new MappedPlatformAddress(value, size);
return addr;
|
public static PlatformAddress | on(int value)
return PlatformAddressFactory.on(value, PlatformAddress.UNKNOWN);
|
public static PlatformAddress | on(int value, long size)
PlatformAddress addr = (value == 0) ? PlatformAddress.NULL : new PlatformAddress(value, size);
return addr;
|