elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
elkscmd
/
busyelks
/
lib
/
chunks.c
File editor
/* * Copyright (c) 1993 by David I. Bell * Permission is granted to use, distribute, or modify this source, * provided that this copyright notice remains intact. * * Utility routines. */ #include "../sash.h" #include <sys/types.h> #include <sys/stat.h> #include <dirent.h> #include <time.h> #include <utime.h> static CHUNK * chunklist; /* * Allocate a chunk of memory (like malloc). * The difference, though, is that the memory allocated is put on a * list of chunks which can be freed all at one time. You CAN NOT free * an individual chunk. */ char *getchunk(int size) { CHUNK *chunk; if (size < CHUNKINITSIZE) size = CHUNKINITSIZE; chunk = (CHUNK *) malloc(size + sizeof(CHUNK) - CHUNKINITSIZE); if (chunk == NULL) return NULL; chunk->next = chunklist; chunklist = chunk; return chunk->data; } /* * Free all chunks of memory that had been allocated since the last * call to this routine. */ void freechunks(void) { CHUNK *chunk; while (chunklist) { chunk = chunklist; chunklist = chunk->next; free((char *) chunk); } }
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history