Initial import

This commit is contained in:
Justine Tunney 2020-06-15 07:18:57 -07:00
commit c91b3c5006
14915 changed files with 590219 additions and 0 deletions

View 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;
}