Initial import
This commit is contained in:
15
third_party/dlmalloc/malloc_footprint_limit.c
vendored
Normal file
15
third_party/dlmalloc/malloc_footprint_limit.c
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "libc/limits.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/dlmalloc/dlmalloc.h"
|
||||
|
||||
/**
|
||||
* Returns the number of bytes that the heap is allowed to obtain from
|
||||
* the system, returning the last value returned by
|
||||
* malloc_set_footprint_limit, or the maximum size_t value if never set.
|
||||
* The returned value reflects a permission. There is no guarantee that
|
||||
* this number of bytes can actually be obtained from the system.
|
||||
*/
|
||||
size_t malloc_footprint_limit(void) {
|
||||
size_t maf = gm->footprint_limit;
|
||||
return maf == 0 ? SIZE_MAX : maf;
|
||||
}
|
||||
Reference in New Issue
Block a user