diff options
| author | Marcin Bukat <marcin.bukat@gmail.com> | 2013-08-22 12:12:47 +0200 |
|---|---|---|
| committer | Marcin Bukat <marcin.bukat@gmail.com> | 2013-08-26 09:42:47 +0200 |
| commit | a2a2e14e0d400e1c82b4d02c4399602488578dc6 (patch) | |
| tree | 87e63279ef95ce06315b492d85a009b58f3782b2 /apps/plugins/lua/rockmalloc.h | |
| parent | b2e80edd1671833dc80eb0c5334cb6a2c58808e0 (diff) | |
| download | rockbox-a2a2e14e0d400e1c82b4d02c4399602488578dc6.zip rockbox-a2a2e14e0d400e1c82b4d02c4399602488578dc6.tar.gz rockbox-a2a2e14e0d400e1c82b4d02c4399602488578dc6.tar.bz2 rockbox-a2a2e14e0d400e1c82b4d02c4399602488578dc6.tar.xz | |
lua: Switch memory allocator from dl to tlsf
Instead of providing yet another memory allocator implementation
use tlsf and simply link tlsf library.
Another small improvement is to *grow* memory pool by grabbing
audiobuffer instead of just switching to use audiobuf exclusively.
Tested with simple lua 'memory eater' script.
This patch extends tlsf lib slightly. You can provide
void *get_new_area(size_t * size) function which will override
weak dummy implementation provided in lib itself. This allows to
automaticaly initialize memory pool as well as grow memory
pool if needed (for example grab audiobuffer when pluginbuffer
is exhaused).
Change-Id: I841af6b6b5bbbf546c14cbf139a7723fbb982f1b
Diffstat (limited to 'apps/plugins/lua/rockmalloc.h')
| -rw-r--r-- | apps/plugins/lua/rockmalloc.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/apps/plugins/lua/rockmalloc.h b/apps/plugins/lua/rockmalloc.h deleted file mode 100644 index 256c583..0000000 --- a/apps/plugins/lua/rockmalloc.h +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 Dan Everton (safetydan) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#ifndef _ROCKMALLOC_H_ -#define _ROCKMALLOC_H_ - -#undef WIN32 -#undef _WIN32 -#define LACKS_UNISTD_H -#define LACKS_SYS_PARAM_H -#define LACKS_SYS_MMAN_H -#define LACKS_STRINGS_H -#define INSECURE 1 -#define USE_DL_PREFIX 1 -#define MORECORE_CANNOT_TRIM 1 -#define HAVE_MMAP 0 -#define HAVE_MREMAP 0 -#define NO_MALLINFO 1 -#define ABORT ((void) 0) -/* #define DEBUG */ -#define MORECORE rocklua_morecore - -void *rocklua_morecore(int size); -void dlmalloc_stats(void); - -#define printf DEBUGF - -#endif |