Commit Graph

2 Commits

Author SHA1 Message Date
Robert Bragg
a0441778ad This re-licenses Cogl 1.18 under the MIT license
Since the Cogl 1.18 branch is actively maintained in parallel with the
master branch; this is a counter part to commit 1b83ef938fc16b which
re-licensed the master branch to use the MIT license.

This re-licensing is a follow up to the proposal that was sent to the
Cogl mailing list:
http://lists.freedesktop.org/archives/cogl/2013-December/001465.html

Note: there was a copyright assignment policy in place for Clutter (and
therefore Cogl which was part of Clutter at the time) until the 11th of
June 2010 and so we only checked the details after that point (commit
0bbf50f905)

For each file, authors were identified via this Git command:
$ git blame -p -C -C -C20 -M -M10  0bbf50f905..HEAD

We received blanket approvals for re-licensing all Red Hat and Collabora
contributions which reduced how many people needed to be contacted
individually:
- http://lists.freedesktop.org/archives/cogl/2013-December/001470.html
- http://lists.freedesktop.org/archives/cogl/2014-January/001536.html

Individual approval requests were sent to all the other identified authors
who all confirmed the re-license on the Cogl mailinglist:
http://lists.freedesktop.org/archives/cogl/2014-January

As well as updating the copyright header in all sources files, the
COPYING file has been updated to reflect the license change and also
document the other licenses used in Cogl such as the SGI Free Software
License B, version 2.0 and the 3-clause BSD license.

This patch was not simply cherry-picked from master; but the same
methodology was used to check the source files.
2014-02-22 02:02:53 +00:00
Robert Bragg
882ff5612b Adds a "magazine" allocator for chunks of fixed size
This adds a very minimal and fast allocator for chunks of memory of a
predetermined size. This has some similarities to the glib slice
allocator although notably it is not thread safe and instead of
internally tracking multiple magazines for various sized allocations the
api lets you explicitly allocate a single magazine for a single specific
size and a pointer to the magazine is passed explicitly to the allocate
and free functions.

This allocator builds on the CoglMemoryStack allocator as an underlying
heap allocator and just never rewinds the stack. This means the heap is
effectively a grow only linked list of malloc()'d blocks of memory.

A CoglMagazine tracks a singly linked list of chunks of a predetermined
size and _cogl_magazine_chunk_alloc() simply unlinks and returns the
head of the list. If the list is empty it falls back to allocating from
the underlying stack.

_cogl_magazine_chunk_free() links the chunk back into the singly linked
list for re-use.

The chunk size passed to _cogl_magazine_new() is automatically rounded
to a multiple of 8 bytes to ensure that all stack allocations end up
aligned to 8 bytes. This also ensures that when a chunk is freed then it
will be large enough to store a pointer to the next free chunk as part
of a singly linked list.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 17799c2f109a008d6cf767f501b81aa9b32bbda8)
2012-08-06 14:27:40 +01:00