diff options
| author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2005-07-27 23:17:31 +0000 |
|---|---|---|
| committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2005-07-27 23:17:31 +0000 |
| commit | 73864adbd49e6f78fcb4edba8faf2a88da711af6 (patch) | |
| tree | 0f97e9d7167b3d6cb532fced4a57c45db549e7b7 /sys/kern/kern_malloc.c | |
| parent | ea35a2ec3aa53656bfc46869268a7b834b87c53d (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_malloc.c')
| -rw-r--r-- | sys/kern/kern_malloc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 6f8518f26113..0e3403bf1521 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -213,8 +213,10 @@ malloc_type_zone_allocated(struct malloc_type *mtp, unsigned long size, critical_enter(); mtip = mtp->ks_handle; mtsp = &mtip->mti_stats[curcpu]; - mtsp->mts_memalloced += size; - mtsp->mts_numallocs++; + if (size > 0) { + mtsp->mts_memalloced += size; + mtsp->mts_numallocs++; + } if (zindx != -1) mtsp->mts_size |= 1 << zindx; critical_exit(); @@ -224,7 +226,8 @@ void malloc_type_allocated(struct malloc_type *mtp, unsigned long size) { - malloc_type_zone_allocated(mtp, size, -1); + if (size > 0) + malloc_type_zone_allocated(mtp, size, -1); } /* |
