瀏覽代碼

Add note about high resource-consumption in LWIP_PLATFORM_DIAG and LWIP_PLATFORM_ASSERT default implementations

Dirk Ziegelmeier 9 年之前
父節點
當前提交
e3c2b8a339
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/include/lwip/arch.h

+ 10 - 2
src/include/lwip/arch.h

@@ -70,14 +70,22 @@
 #define LWIP_RAND() ((u32_t)rand())
 #endif
 
-/** Platform specific diagnostic output */
+/** Platform specific diagnostic output.\n
+ * Note the default implementation pulls in printf, which may
+ * in turn pull in a lot of standard libary code. In resource-constrained 
+ * systems, this should be defined to something less resource-consuming.
+ */
 #ifndef LWIP_PLATFORM_DIAG
 #define LWIP_PLATFORM_DIAG(x)	do {printf x;} while(0)
 #include <stdio.h>
 #include <stdlib.h>
 #endif
 
-/** Platform specific assertion handling */
+/** Platform specific assertion handling.\n
+ * Note the default implementation pulls in printf, fflush and abort, which may
+ * in turn pull in a lot of standard libary code. In resource-constrained 
+ * systems, this should be defined to something less resource-consuming.
+ */
 #ifndef LWIP_PLATFORM_ASSERT
 #define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \
                                      x, __LINE__, __FILE__); fflush(NULL); abort();} while(0)