Deleted Added
full compact
29c29
< __FBSDID("$FreeBSD: head/sys/vm/memguard.c 216425 2010-12-14 05:47:35Z alc $");
---
> __FBSDID("$FreeBSD: head/sys/vm/memguard.c 226313 2011-10-12 18:08:28Z glebius $");
58a59
> #include <vm/uma_int.h>
128,130c129,132
< #define MG_GUARD 0x001
< #define MG_ALLLARGE 0x002
< static int memguard_options = MG_GUARD;
---
> #define MG_GUARD_AROUND 0x001
> #define MG_GUARD_ALLLARGE 0x002
> #define MG_GUARD_NOFREE 0x004
> static int memguard_options = MG_GUARD_AROUND;
136c138,139
< "\t0x002 - always use MemGuard for allocations over a page");
---
> "\t0x002 - always use MemGuard for allocations over a page\n"
> "\t0x004 - guard uma(9) zones with UMA_ZONE_NOFREE flag");
285c288
< do_guard = (memguard_options & MG_GUARD) != 0;
---
> do_guard = (memguard_options & MG_GUARD_AROUND) != 0;
432,433c435,436
< int
< memguard_cmp(struct malloc_type *mtp, unsigned long size)
---
> static int
> memguard_cmp(unsigned long size)
440c443
< if ((memguard_options & MG_ALLLARGE) != 0 && size >= PAGE_SIZE)
---
> if ((memguard_options & MG_GUARD_ALLLARGE) != 0 && size >= PAGE_SIZE)
446a450,460
>
> return (0);
> }
>
> int
> memguard_cmp_mtp(struct malloc_type *mtp, unsigned long size)
> {
>
> if (memguard_cmp(size))
> return(1);
>
469a484,501
>
> int
> memguard_cmp_zone(uma_zone_t zone)
> {
>
> if ((memguard_options & MG_GUARD_NOFREE) == 0 &&
> zone->uz_flags & UMA_ZONE_NOFREE)
> return (0);
>
> if (memguard_cmp(zone->uz_size))
> return (1);
>
> /*
> * The safest way of comparsion is to always compare zone name,
> * but it is also the slowest way.
> */
> return (strcmp(zone->uz_name, vm_memguard_desc) == 0);
> }