summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index cdc9f6a..e699548 100644
--- a/buffer.c
+++ b/buffer.c
@@ -92,6 +92,11 @@ static void buffer_append_redo(TextBuffer *buffer, BufferEdit const *edit) {
if (!buffer->redo_history) buffer_out_of_mem(buffer);
}
+static void *buffer_malloc(TextBuffer *buffer, size_t size) {
+ void *ret = malloc(size);
+ if (!ret) buffer_out_of_mem(buffer);
+ return ret;
+}
static void *buffer_calloc(TextBuffer *buffer, size_t n, size_t size) {
void *ret = calloc(n, size);