diff options
author | Max Horn | 2009-03-10 19:08:07 +0000 |
---|---|---|
committer | Max Horn | 2009-03-10 19:08:07 +0000 |
commit | 4da6fbbb76987ea6f2c7cef70da6a9e497fddf2d (patch) | |
tree | 0da84a11ed4d1ee363700a841c561f4816cb299f /engines/sci/sci_memory.h | |
parent | 39359479ea4e3a2bf7a335a51c9e28c7515669ff (diff) | |
download | scummvm-rg350-4da6fbbb76987ea6f2c7cef70da6a9e497fddf2d.tar.gz scummvm-rg350-4da6fbbb76987ea6f2c7cef70da6a9e497fddf2d.tar.bz2 scummvm-rg350-4da6fbbb76987ea6f2c7cef70da6a9e497fddf2d.zip |
SCI: Memory 'ref counting' code is only used by song iterators -> move it there, make it private (to be replaced one day by something else, e.g. Common::SharedPtr)
svn-id: r39305
Diffstat (limited to 'engines/sci/sci_memory.h')
-rw-r--r-- | engines/sci/sci_memory.h | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/engines/sci/sci_memory.h b/engines/sci/sci_memory.h index 49b75e1685..d3bc4a16d9 100644 --- a/engines/sci/sci_memory.h +++ b/engines/sci/sci_memory.h @@ -24,20 +24,7 @@ */ -/** This header file defines a portable library for allocating memory safely - ** throughout FreeSCI. - ** Implementations of basic functions found here are in this file and - ** $(SRCDIR)/src/scicore/sci_memory.c - * - ************** - * - * Sets behaviour if memory allocation call fails. - * UNCHECKED_MALLOCS: use C library routine without checks - * (nothing defined): check mallocs and exit immediately on fail (recommended) - * - ** -- Alex Angas - ** - **/ +// This header file defines a portable library for allocating memory safely. #ifndef SCI_SCI_MEMORY_H @@ -99,43 +86,6 @@ extern char *sci_strndup(const char *src, size_t length); ** See _SCI_MALLOC() for more information if call fails. */ -/****************************************/ -/* Refcounting garbage collected memory */ -/****************************************/ - -/* Refcounting memory calls are a little slower than the others, -** and using it improperly may cause memory leaks. It conserves -** memory, though. */ - -extern void *sci_refcount_alloc(size_t length); -/* Allocates "garbage" memory -** Parameters: (size_t) length: Number of bytes to allocate -** Returns : (void *) The allocated memory -** Memory allocated in this fashion will be marked as holding one reference. -** It cannot be freed with 'free()', only by using sci_refcount_decref(). -*/ - -extern void *sci_refcount_incref(void *data); -/* Adds another reference to refcounted memory -** Parameters: (void *) data: The data to add a reference to -** Returns : (void *) data -*/ - -extern void sci_refcount_decref(void *data); -/* Decrements the reference count for refcounted memory -** Parameters: (void *) data: The data to add a reference to -** Returns : (void *) data -** If the refcount reaches zero, the memory will be deallocated -*/ - -extern void *sci_refcount_memdup(void *data, size_t len); -/* Duplicates non-refcounted memory into a refcounted block -** Parameters: (void *) data: The memory to copy from -** (size_t) len: The number of bytes to copy/allocate -** Returns : (void *) Newly allocated refcounted memory -** The number of references accounted for will be one. -*/ - } // End of namespace Sci #endif // SCI_SCI_MEMORY_H |