Summary: We model `malloc` in Objective-C as `malloc_not_fail` I think because the null case is not normally handled in iOS apps because the OS will just killed the app after giving some memory warnings. So adding `malloc_not_fail` model to Pulse. Reviewed By: jvillard Differential Revision: D21278527 fbshipit-source-id: 17a5008femaster
parent
fa13577695
commit
f28d75c910
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
void wrap_free(void* x) { free(x); }
|
||||
|
||||
void interproc_free_ok() {
|
||||
int* p = malloc(sizeof(int));
|
||||
wrap_free(p);
|
||||
}
|
||||
|
||||
void leak_bad() { int* p = malloc(sizeof(int)); }
|
Loading…
Reference in new issue