memalloc.c (151795) | memalloc.c (193221) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/bin/sh/memalloc.c 151795 2005-10-28 10:45:19Z stefanf $"); | 39__FBSDID("$FreeBSD: head/bin/sh/memalloc.c 193221 2009-06-01 10:50:17Z rse $"); |
40 41#include <sys/param.h> 42#include "shell.h" 43#include "output.h" 44#include "memalloc.h" 45#include "error.h" 46#include "mystring.h" 47#include "expand.h" 48#include <stdlib.h> 49#include <unistd.h> 50 51/* 52 * Like malloc, but returns an error when out of space. 53 */ 54 55pointer | 40 41#include <sys/param.h> 42#include "shell.h" 43#include "output.h" 44#include "memalloc.h" 45#include "error.h" 46#include "mystring.h" 47#include "expand.h" 48#include <stdlib.h> 49#include <unistd.h> 50 51/* 52 * Like malloc, but returns an error when out of space. 53 */ 54 55pointer |
56ckmalloc(int nbytes) | 56ckmalloc(size_t nbytes) |
57{ 58 pointer p; 59 60 INTOFF; 61 p = malloc(nbytes); 62 INTON; 63 if (p == NULL) 64 error("Out of space"); --- 275 unchanged lines hidden --- | 57{ 58 pointer p; 59 60 INTOFF; 61 p = malloc(nbytes); 62 INTON; 63 if (p == NULL) 64 error("Out of space"); --- 275 unchanged lines hidden --- |