From owner-freebsd-hackers Thu Jan 28 05:49:17 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA18175 for freebsd-hackers-outgoing; Thu, 28 Jan 1999 05:49:17 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from chouette.inria.fr (chouette.inria.fr [138.96.24.103]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA18164 for ; Thu, 28 Jan 1999 05:49:08 -0800 (PST) (envelope-from Emmanuel.Duros@sophia.inria.fr) Received: by chouette.inria.fr (8.8.8/8.8.5) id OAA24119; Thu, 28 Jan 1999 14:49:03 +0100 (MET) Date: Thu, 28 Jan 1999 14:49:03 +0100 (MET) Message-Id: <199901281349.OAA24119@chouette.inria.fr> From: Emmanuel Duros To: freebsd-hackers@FreeBSD.ORG Subject: rules to allocate buffers in device drivers X-URL: http://www.inria.fr/rodeo/personnel/eduros Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I am currently writing a network device driver for FreeBSD and it is still unclear to me how to allocate memory. It seems that a common way of doing it is something like: u_char *buffer; buffer = malloc( SIZE, M_DEVBUF, M_NOWAIT); However I have not seen something like this in a device driver: u_char buffer[SIZE]; Is there a particular reason for not allocating buffers statically ? I have not found anything related to how to allocate memory in kernel code (definitions of malloc parameters, etc.). Do you have any pointer on that ? Thanks Emmanuel Duros To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message