mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Initial import
This commit is contained in:
commit
c91b3c5006
14915 changed files with 590219 additions and 0 deletions
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue