mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
Don't allocate a megabyte on the stack
git-svn-id: file:///svn/tokudb@472 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
9fefe9b291
commit
2905012406
1 changed files with 3 additions and 1 deletions
|
@ -77,7 +77,8 @@ void serialize_brtnode_to(int fd, diskoff off, diskoff size, BRTNODE node) {
|
|||
struct wbuf w;
|
||||
int i;
|
||||
unsigned int calculated_size = serialize_brtnode_size(node);
|
||||
char buf[size];
|
||||
//char buf[size];
|
||||
char *MALLOC_N(size,buf);
|
||||
assert(size>0);
|
||||
wbuf_init(&w, buf, size);
|
||||
//printf("%s:%d serializing %lld w height=%d p0=%p\n", __FILE__, __LINE__, off, node->height, node->mdicts[0]);
|
||||
|
@ -124,6 +125,7 @@ void serialize_brtnode_to(int fd, diskoff off, diskoff size, BRTNODE node) {
|
|||
|
||||
//printf("%s:%d wrote %d bytes for %lld size=%lld\n", __FILE__, __LINE__, w.ndone, off, size);
|
||||
assert(w.ndone<=size);
|
||||
toku_free(buf);
|
||||
}
|
||||
|
||||
int deserialize_brtnode_from (int fd, diskoff off, BRTNODE *brtnode, int nodesize) {
|
||||
|
|
Loading…
Add table
Reference in a new issue