Skip to content
Browse files

license update

  • Loading branch information...
1 parent 1618424 commit 351d6119ec04999ba786f9815772f9b6d0baed89 @dividuum committed Feb 17, 2012
Showing with 193 additions and 33 deletions.
  1. +57 −0 LICENSE.txt
  2. +2 −1 Makefile
  3. +90 −0 README.tlsf.txt
  4. +1 −26 font.c
  5. +2 −0 font.h
  6. +2 −0 framebuffer.c
  7. +2 −0 framebuffer.h
  8. +17 −0 image.c
  9. +2 −0 image.h
  10. +2 −0 kernel.lua
  11. +2 −0 main.c
  12. +2 −0 misc.c
  13. +2 −0 misc.h
  14. +2 −0 struct.h
  15. +6 −6 video.c
  16. +2 −0 video.h
View
57 LICENSE.txt
@@ -0,0 +1,57 @@
+This program is licensed under the BSD 2-Clause License:
+
+ Copyright (c) 2012, Florian Wesch <fw@dividuum.de>
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Some files include external code. License information about these
+files in included in their header.
+
+ image.c
+ PNG & JPEG loading based on example code
+ http://tfc.duke.free.fr/
+ http://files.slembcke.net/misc/PNGTexture.tar.gz
+
+ video.c
+ Includes code from ffmpeg example code
+ http://bit.ly/w3iOvz
+
+3rd Party code:
+
+ tlsf.c tlsf.h tlsfbits.h
+ TLSF memory allocator
+ http://tlsf.baisoku.org/
+
+ uthash.h utlist.h
+ Hashtables/Lists for C structures
+ http://uthash.sourceforge.net/
+
+ bin2c.c
+ Convert file to C include
+
+ struct.c
+ Library for packing/unpacking structures.
+ http://www.inf.puc-rio.br/~roberto/struct/
+
View
3 Makefile
@@ -1,5 +1,6 @@
-VERSION="rev-$(shell git rev-parse --short=6 HEAD)"
+# See Copyright Notice in LICENSE.txt
+VERSION="rev-$(shell git rev-parse --short=6 HEAD)"
ifdef DEBUG
CFLAGS ?= -ggdb -DDEBUG
View
90 README.tlsf.txt
@@ -0,0 +1,90 @@
+Two Level Segregated Fit memory allocator implementation.
+Written by Matthew Conte (matt@baisoku.org).
+Public Domain, no restrictions.
+
+ http://tlsf.baisoku.org
+
+Notes
+-----
+This code was written to the TLSF 1.4 spec and documentation found at:
+
+ http://rtportal.upv.es/rtmalloc/allocators/tlsf/index.shtml
+
+It also uses the TLSF 2.0 improvement to shrink the per-block overhead
+from 8 to 4 bytes.
+
+Features
+--------
+* O(1) cost for malloc, free, realloc, memalign
+* Extremely low overhead per allocation (4 bytes)
+* Low overhead per pool (~3kB)
+* Low fragmentation
+* Compiles to only a few kB of code and data
+
+Caveats
+-------
+* Currently, assumes architecture can make 4-byte aligned accesses
+* Not designed to be thread safe; the user must provide this
+
+Known Issues
+------------
+* Due to the internal block structure size and the implementation
+details of tlsf_memalign, there is worst-case behavior when requesting
+small (<16 byte) blocks aligned to 8-byte boundaries. Overuse of memalign
+will generally increase fragmentation, but this particular case will leave
+lots of unusable "holes" in the heap. The solution would be to internally
+align all blocks to 8 bytes, but this will require significantl changes
+to the implementation. Contact me if you are interested.
+
+History
+-------
+2011/10/20 - v2.0
+ * 64-bit support
+ * More compiler intrinsics for ffs/fls
+ * ffs/fls verification during pool creation in debug builds
+
+2008/04/04 - v1.9
+ * Add tlsf_heap_check, a heap integrity check
+ * Support a predefined tlsf_assert macro
+ * Fix realloc case where block should shrink; if adjacent block is
+ in use, execution would go down the slow path
+
+2007/02/08 - v1.8
+ * Fix for unnecessary reallocation in tlsf_realloc
+
+2007/02/03 - v1.7
+ * tlsf_heap_walk takes a callback
+ * tlsf_realloc now returns NULL on failure
+ * tlsf_memalign optimization for 4-byte alignment
+ * Usage of size_t where appropriate
+
+2006/11/21 - v1.6
+ * ffs/fls broken out into tlsfbits.h
+ * tlsf_overhead queries per-pool overhead
+
+2006/11/07 - v1.5
+ * Smart realloc implementation
+ * Smart memalign implementation
+
+2006/10/11 - v1.4
+ * Add some ffs/fls implementations
+ * Minor code footprint reduction
+
+2006/09/14 - v1.3
+ * Profiling indicates heavy use of blocks of
+ size 1-128, so implement small block handling
+ * Reduce pool overhead by about 1kb
+ * Reduce minimum block size from 32 to 12 bytes
+ * Realloc bug fix
+
+2006/09/09 - v1.2
+ * Add tlsf_block_size
+ * Static assertion mechanism for invariants
+ * Minor bugfixes
+
+2006/09/01 - v1.1
+ * Add tlsf_realloc
+ * Add tlsf_walk_heap
+
+2006/08/25 - v1.0
+ * First release
View
27 font.c
@@ -1,28 +1,4 @@
-/* Based on a FTGL example program */
-/*
- * c-demo.cpp - simple C demo for FTGL, the OpenGL font library
- *
- * Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
+/* See Copyright Notice in LICENSE.txt */
#include <stdio.h>
#include <stdlib.h>
@@ -40,7 +16,6 @@ typedef struct {
FTGLfont *font;
} font_t;
-
static font_t *to_font(lua_State *L, int index) {
font_t *font = (font_t *)lua_touserdata(L, index);
if (!font) luaL_typerror(L, index, FONT);
View
2 font.h
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#ifndef FONT_H
#define FONT_H
View
2 framebuffer.c
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
View
2 framebuffer.h
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H
View
17 image.c
@@ -1,3 +1,20 @@
+/* See Copyright Notice in LICENSE.txt */
+
+/* JPEG loader is based on jpeg.c from
+ * http://tfc.duke.free.fr/
+ *
+ * License: "All these programs are Open Source. Some old
+ * works haven't been tagged yet with a licence. I assume
+ * they are licensed under the MIT-license, like a majority
+ * of my other works."
+ *
+ *
+ * PNG loader is based on
+ * http://files.slembcke.net/misc/PNGTexture.tar.gz
+ *
+ * License: unknown
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
View
2 image.h
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#ifndef IMAGE_H
#define IMAGE_H
View
2 kernel.lua
@@ -1,3 +1,5 @@
+-- See Copyright Notice in LICENSE.txt
+
--======================
-- Wrap unsafe functions
--======================
View
2 main.c
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#define _BSD_SOURCE
#include <linux/limits.h>
#include <strings.h>
View
2 misc.c
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
View
2 misc.h
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#ifndef MISC_H
#define MISC_H
View
2 struct.h
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#ifndef STRUCT_H
#define STRUCT_H
View
12 video.c
@@ -1,11 +1,11 @@
+/* See Copyright Notice in LICENSE.txt */
+
/*
- * Video Module for GPN News.
- * Adapted from code by Michael Meeuwisse
- */
-/*
+ * Includes from code by Michael Meeuwisse
* https://docs.google.com/leaf?id=0B_dz2NwhjXB-NDQ0NWNjOWEtMzJiNy00ZjcwLWJjMjYtZTU2YmQzMWMzYmU0
- */
-/*
+ *
+ * License:
+ *
* (C) Copyright 2010 Michael Meeuwisse
*
* Adapted from avcodec_sample.0.5.0.c, license unknown
View
2 video.h
@@ -1,3 +1,5 @@
+/* See Copyright Notice in LICENSE.txt */
+
#ifndef VIDEO_H
#define VIDEO_H

0 comments on commit 351d611

Please sign in to comment.
Something went wrong with that request. Please try again.