mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-08 19:10:53 +00:00
Use malloc instead of mmap for now
This commit is contained in:
parent
0edc08029e
commit
2ad4228493
@ -32,7 +32,7 @@
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_length = length;
|
||||
_isVM = (length >= vm_page_size);
|
||||
_isVM = false;//(length >= vm_page_size);
|
||||
if (_isVM) {
|
||||
_mutableBytes = mmap(NULL, length, PROT_WRITE | PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_DATA), 0);
|
||||
if (_mutableBytes == MAP_FAILED) {
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
// Check the VM flag again because we may have failed above.
|
||||
if (!_isVM) {
|
||||
_mutableBytes = calloc(1, length);
|
||||
_mutableBytes = malloc(length);
|
||||
}
|
||||
}
|
||||
return self;
|
||||
|
Loading…
x
Reference in New Issue
Block a user