| 437 | } |
| 438 | |
| 439 | static int |
| 440 | memguard_cmp(unsigned long size) |
| 441 | { |
| 442 | |
| 443 | if (size < memguard_minsize) { |
| 444 | memguard_minsize_reject++; |
| 445 | return (0); |
| 446 | } |
| 447 | if ((memguard_options & MG_GUARD_ALLLARGE) != 0 && size >= PAGE_SIZE) |
| 448 | return (1); |
| 449 | if (memguard_frequency > 0 && |
| 450 | (random() % 100000) < memguard_frequency) { |
| 451 | memguard_frequency_hits++; |
| 452 | return (1); |
| 453 | } |
| 454 | |
| 455 | return (0); |
| 456 | } |
| 457 | |
| 458 | int |
| 459 | memguard_cmp_mtp(struct malloc_type *mtp, unsigned long size) |
no test coverage detected