-/* $OpenBSD: kern_malloc.c,v 1.106 2014/04/03 21:36:59 tedu Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.107 2014/05/19 14:30:03 tedu Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
/* and check that the data hasn't been modified. */
if (freshalloc == 0) {
size_t pidx;
- int pval;
+ uint32_t pval;
if (poison_check(va, allocsize, &pidx, &pval)) {
panic("%s %zd of object %p size 0x%lx %s %s"
" (0x%x != 0x%x)\n",
-/* $OpenBSD: subr_poison.c,v 1.6 2014/01/13 09:27:39 mpi Exp $ */
+/* $OpenBSD: subr_poison.c,v 1.7 2014/05/19 14:30:03 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
#endif
#define POISON_SIZE 64
-int32_t
+uint32_t
poison_value(void *v)
{
ulong l = (u_long)v;
{
uint32_t *ip = v;
size_t i;
- int32_t poison;
+ uint32_t poison;
poison = poison_value(v);
}
int
-poison_check(void *v, size_t len, size_t *pidx, int *pval)
+poison_check(void *v, size_t len, size_t *pidx, uint32_t *pval)
{
uint32_t *ip = v;
size_t i;
- int32_t poison;
+ uint32_t poison;
poison = poison_value(v);
-/* $OpenBSD: subr_pool.c,v 1.127 2014/05/01 04:25:02 tedu Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.128 2014/05/19 14:30:03 tedu Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
pp->pr_wchan, ph->ph_page, pi, 0, pi->pi_magic);
if (pool_debug && ph->ph_magic) {
size_t pidx;
- int pval;
+ uint32_t pval;
if (poison_check(pi + 1, pp->pr_size - sizeof(*pi),
&pidx, &pval)) {
int *ip = (int *)(pi + 1);
}
if (pool_debug && ph->ph_magic) {
size_t pidx;
- int pval;
+ uint32_t pval;
if (poison_check(pi + 1, pp->pr_size - sizeof(*pi),
&pidx, &pval)) {
int *ip = (int *)(pi + 1);
-/* $OpenBSD: malloc.h,v 1.107 2013/06/03 15:56:01 tedu Exp $ */
+/* $OpenBSD: malloc.h,v 1.108 2014/05/19 14:30:03 tedu Exp $ */
/* $NetBSD: malloc.h,v 1.39 1998/07/12 19:52:01 augustss Exp $ */
/*
void malloc_printit(int (*)(const char *, ...));
void poison_mem(void *, size_t);
-int poison_check(void *, size_t, size_t *, int *);
-int32_t poison_value(void *);
+int poison_check(void *, size_t, size_t *, uint32_t *);
+uint32_t poison_value(void *);
#ifdef MALLOC_DEBUG
int debug_malloc(unsigned long, int, int, void **);