mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-29 08:29:03 +03:00
util/nvmutil: use fixed buffer
modern malloc implementations make the optimisation here pretty pointless. modern computers make this modification pointless. i'm not planning to run nvmutil on a VAX. openbsd removed support for it ages ago. 8KB fixed buffer is fine. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -38,6 +38,7 @@ uint16_t word(int, int);
|
||||
#define SIZE_16KB 0x4000
|
||||
#define SIZE_128KB 0x20000
|
||||
|
||||
uint8_t buf[SIZE_8KB];
|
||||
uint16_t mac[3] = {0, 0, 0};
|
||||
ssize_t nf;
|
||||
size_t partsize;
|
||||
@@ -197,11 +198,6 @@ nvmalloc(void)
|
||||
if ((cmd == cmd_copy) || (cmd == cmd_setchecksum) || (cmd == cmd_brick))
|
||||
do_read[part ^ 1] = 0;
|
||||
|
||||
/* only allocate one block if only one part being read */
|
||||
uint8_t *buf = (uint8_t *) malloc(nf << (do_read[0] & do_read[1]));
|
||||
if (buf == NULL)
|
||||
err(errno, NULL);
|
||||
|
||||
gbe[0] = buf;
|
||||
|
||||
/* speedhack: for cmd copy, both pointers are set the same */
|
||||
|
||||
Reference in New Issue
Block a user