Applied patch from Larry Doolittle to give users the third option of putting
buffers in BSS (in addition to stack and heap).
This commit is contained in:
5
Config.h
5
Config.h
@@ -144,6 +144,11 @@
|
|||||||
// them put on the stack. For some very small machines with limited stack
|
// them put on the stack. For some very small machines with limited stack
|
||||||
// space, this can be deadly. For most folks, this works just fine...
|
// space, this can be deadly. For most folks, this works just fine...
|
||||||
//#define BB_FEATURE_BUFFERS_GO_ON_STACK
|
//#define BB_FEATURE_BUFFERS_GO_ON_STACK
|
||||||
|
// The third alternative for buffer allocation is to use BSS. This works
|
||||||
|
// beautifully for computers with a real MMU (and OS support), but wastes
|
||||||
|
// runtime RAM for uCLinux. This behavior was the only one available for
|
||||||
|
// BusyBox versions 0.48 and earlier.
|
||||||
|
//#define BB_FEATURE_BUFFERS_GO_IN_BSS
|
||||||
//
|
//
|
||||||
// Turn this on to use Erik's very cool devps, and devmtab kernel drivers,
|
// Turn this on to use Erik's very cool devps, and devmtab kernel drivers,
|
||||||
// thereby eliminating the need for the /proc filesystem and thereby saving
|
// thereby eliminating the need for the /proc filesystem and thereby saving
|
||||||
|
@@ -72,9 +72,14 @@ extern const char *applet_name;
|
|||||||
#define RESERVE_BB_BUFFER(buffer,len) char buffer[len]
|
#define RESERVE_BB_BUFFER(buffer,len) char buffer[len]
|
||||||
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len]
|
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len]
|
||||||
#else
|
#else
|
||||||
|
#ifdef BB_FEATURE_BUFFERS_GO_IN_BSS
|
||||||
|
#define RESERVE_BB_BUFFER(buffer,len) static char buffer[len]
|
||||||
|
#define RESERVE_BB_UBUFFER(buffer,len) static unsigned char buffer[len]
|
||||||
|
#else
|
||||||
#define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len)
|
#define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len)
|
||||||
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
|
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Bit map related macros -- libc5 doens't provide these... sigh. */
|
/* Bit map related macros -- libc5 doens't provide these... sigh. */
|
||||||
|
@@ -72,9 +72,14 @@ extern const char *applet_name;
|
|||||||
#define RESERVE_BB_BUFFER(buffer,len) char buffer[len]
|
#define RESERVE_BB_BUFFER(buffer,len) char buffer[len]
|
||||||
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len]
|
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len]
|
||||||
#else
|
#else
|
||||||
|
#ifdef BB_FEATURE_BUFFERS_GO_IN_BSS
|
||||||
|
#define RESERVE_BB_BUFFER(buffer,len) static char buffer[len]
|
||||||
|
#define RESERVE_BB_UBUFFER(buffer,len) static unsigned char buffer[len]
|
||||||
|
#else
|
||||||
#define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len)
|
#define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len)
|
||||||
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
|
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Bit map related macros -- libc5 doens't provide these... sigh. */
|
/* Bit map related macros -- libc5 doens't provide these... sigh. */
|
||||||
|
Reference in New Issue
Block a user