Removed memorization...
This commit is contained in:
parent
c57760b78d
commit
a8f8ef91fc
38
xtandard.c
38
xtandard.c
@ -162,44 +162,6 @@ void * deallocate (void * data) {
|
||||
return (null);
|
||||
}
|
||||
|
||||
void * memorize (int size) { /* I broke this for testing something out... */
|
||||
static char * buffer = null;
|
||||
char * points = null;
|
||||
static int length = 0;
|
||||
static int chunks = 0;
|
||||
static int loling = 1024;
|
||||
|
||||
if (size == 0) {
|
||||
free (buffer);
|
||||
|
||||
buffer = null;
|
||||
length = 0;
|
||||
chunks = 0;
|
||||
|
||||
return (null);
|
||||
}
|
||||
|
||||
for (; length + size > chunks * loling; ) {
|
||||
int i;
|
||||
|
||||
++chunks;
|
||||
|
||||
buffer = realloc (buffer, (unsigned long int) (chunks * loling));
|
||||
|
||||
fatal_failure (buffer == null, "memorize: Oh no...");
|
||||
|
||||
for (i = (chunks - 1) * loling; i != chunks * loling; ++i) {
|
||||
buffer [i] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
points = & buffer [length];
|
||||
|
||||
length += size;
|
||||
|
||||
return ((void *) points);
|
||||
}
|
||||
|
||||
void * record (void) {
|
||||
char * buffer = null;
|
||||
int offset = 0;
|
||||
|
@ -85,7 +85,6 @@ extern void limit (int * value, int minimum, int maximum);
|
||||
extern void * allocate (int size);
|
||||
extern void * reallocate (void * data, int size);
|
||||
extern void * deallocate (void * data);
|
||||
extern void * memorize (int size);
|
||||
|
||||
extern void * record (void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user