lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RE : [lwip-devel] Can we remove pbuf_init()


From: Jonathan Larmour
Subject: Re: RE : [lwip-devel] Can we remove pbuf_init()
Date: Fri, 27 Jul 2007 16:05:43 +0100
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc3.4.legacy (X11/20060515)

Jonathan Larmour wrote:
[ Old message I know ]
Frédéric BERNON wrote:

Uhmm, it will not change a lot the footprint, but is done for future uses. So, to my point of view, it's better to let it. But it really cause you any problems, remove it...


I agree with Frederic, although I also think there's a lot more could be done to improve stack initialisation so users don't need to make all these individual subsystem initialisation calls.

Perhaps:
 #define pbuf_init() do { } while (0)
so there's no code overhead.

Actually I just went ahead and did this.

Jifl

Index: core/pbuf.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/pbuf.c,v
retrieving revision 1.117
diff -u -5 -p -r1.117 pbuf.c
--- core/pbuf.c 25 Jul 2007 18:53:46 -0000      1.117
+++ core/pbuf.c 27 Jul 2007 15:04:08 -0000
@@ -76,22 +76,10 @@
/* Since the pool is created in memp, PBUF_POOL_BUFSIZE will be automatically
    aligned there. Therefore, PBUF_POOL_BUFSIZE_ALIGNED can be used here. */
 #define PBUF_POOL_BUFSIZE_ALIGNED LWIP_MEM_ALIGN_SIZE(PBUF_POOL_BUFSIZE)

 /**
- * Initializes the pbuf module.
- *
- * Do some checks an initialize the pbuf pool.
- *
- */
-void
-pbuf_init(void)
-{
-  /* nothing to do here */
-}
-
-/**
  * Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type).
  *
  * The actual memory allocated for the pbuf is determined by the
  * layer at which the pbuf is allocated and the requested size
  * (from the size parameter).
Index: include/lwip/pbuf.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/lwip/pbuf.h,v
retrieving revision 1.24
diff -u -5 -p -r1.24 pbuf.h
--- include/lwip/pbuf.h 25 Jul 2007 18:53:46 -0000      1.24
+++ include/lwip/pbuf.h 27 Jul 2007 15:04:08 -0000
@@ -96,11 +96,12 @@ struct pbuf {
    */
   u16_t ref;

 };

-void pbuf_init(void);
+/* Initializes the pbuf module. This call is empty for now, but may not be in future. */
+#define pbuf_init() do { } while (0)

 struct pbuf *pbuf_alloc(pbuf_layer l, u16_t size, pbuf_flag flag);
 void pbuf_realloc(struct pbuf *p, u16_t size);
 u8_t pbuf_header(struct pbuf *p, s16_t header_size);
 void pbuf_ref(struct pbuf *p);

--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine




reply via email to

[Prev in Thread] Current Thread [Next in Thread]