1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-11-05 03:47:17 -05:00

uemacs: Move NBLOCK constant into line.c

This constant is only used in line.c. So just keep it there.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Thiago Farina 2010-11-15 18:40:03 -02:00 committed by Linus Torvalds
parent af19da1a99
commit 10ae171147
2 changed files with 5 additions and 4 deletions

View File

@ -236,7 +236,6 @@
#define NLOCKS 100 /* max # of file locks active */
#define NCOLORS 8 /* number of supported colors */
#define KBLOCK 250 /* sizeof kill buffer chunks */
#define NBLOCK 16 /* line block chunk size */
#define CONTROL 0x0100 /* Control flag, or'ed in */
#define META 0x0200 /* Meta flag, or'ed in */

8
line.c
View File

@ -21,6 +21,8 @@
#include "edef.h"
#include "efunc.h"
#define BLOCK_SIZE 16 /* Line block chunk size. */
/*
* This routine allocates a block of memory large enough to hold a struct line
* containing "used" characters. The block is always rounded up a bit. Return
@ -32,9 +34,9 @@ struct line *lalloc(int used)
struct line *lp;
int size;
size = (used + NBLOCK - 1) & ~(NBLOCK - 1);
if (size == 0) /* Assume that an empty */
size = NBLOCK; /* line is for type-in. */
size = (used + BLOCK_SIZE - 1) & ~(BLOCK_SIZE - 1);
if (size == 0) /* Assume that is an empty. */
size = BLOCK_SIZE; /* Line is for type-in. */
if ((lp = (struct line *)malloc(sizeof(struct line) + size)) == NULL) {
mlwrite("(OUT OF MEMORY)");
return NULL;